Upgrade to Pro — share decks privately, control downloads, hide ads and more …

From Contract Drafting to Software Specification: Linguistic Sources of Ambiguity

From Contract Drafting to Software Specification: Linguistic Sources of Ambiguity

16 февраля, в 16:00 по Москве на очередном исследовательском семинаре об искусственном интеллекте и тестировании. Елена Трещева и Дарья Дегтяренко представят научную работу «От составления контракта до спецификации программного обеспечения: Языковые источники неоднозначности».
На семинаре мы:
-рассмотрим подробную классификацию типов неоднозначности, которой склонны обладать тексты, написанные на естественном языке,
вместе проанализируем много примеров неоднозначности, а также
-поговорим о конкретных рекомендациях по снижению степени неоднозначности в текстах спецификаций и контрактов.
---
Подписывайтесь на Exactpro в социальных сетях:

LinkedIn https://www.linkedin.com/company/exactpro-systems-llc
Twitter https://twitter.com/exactpro
Facebook https://www.facebook.com/exactpro/
Instagram https://www.instagram.com/exactpro/

Подписывайтесь на YouTube канал Exactpro http://www.youtube.com/c/ExactproVlog

Exactpro
PRO

February 16, 2021
Tweet

More Decks by Exactpro

Other Decks in Technology

Transcript

  1. Build Software to Test Software
    exactpro.com
    From Contract Drafting to
    Software Specification:
    Linguistic Sources of Ambiguity
    A Handbook
    Version 1.0

    View Slide

  2. 2 Build Software to Test Software
    exactpro.com
    Daniel M. Berry, Ph.D.
    Computer Science
    University of Waterloo, Canada
    Erik Kamsties, Ph.D.
    Computer Science
    University of Essen, Germany
    Michael M. Krieger, Ph.D.
    Mathematics, J.D.
    University of California, Los Angeles
    Meet the Authors

    View Slide

  3. 3 Build Software to Test Software
    exactpro.com
    "Please press ANY key to continue..."

    View Slide

  4. 4 Build Software to Test Software
    exactpro.com
    Don Gause lists the five most
    important sources of
    requirements failure as:
    - failure to effectively manage
    conflict,
    - lack of clear statement of the
    design problem to be solved,
    - too much unrecognized
    disambiguation,
    - not knowing who is
    responsible for what, and
    - lack of awareness of
    requirements risk.
    1 Intro

    View Slide

  5. 5 Build Software to Test Software
    exactpro.com
    Linguistics vs Pragmatics
    –“Interestingly, correct use of the natural
    language eliminates most of the ambiguities”.
    Two people who know the rules well or two
    people who don’t know the rules well tend to
    communicate well.
    BUT!
    But one person who knows the rules well and
    one person who doesn’t tend to communicate
    poorly.
    → Pragmatic Ambiguity

    View Slide

  6. 6 Build Software to Test Software
    exactpro.com
    2 Commonalities and Differences
    1. the requirement to be precise and accurate, to be self-consistent, and to
    anticipate all possible contingencies, and
    2. the fact that most such documents are written mostly in natural language.
    Beyond these commonalities there are commonalities and differences in the
    contents and structure of the documents and in the processes by which the
    documents are generated and maintained.
    There are commonalities and differences in how the documents are generated
    and maintained.

    View Slide

  7. 7 Build Software to Test Software
    exactpro.com
    Four Classes of Linguistic Ambiguity
    Lexical ambiguity
    Syntactic ambiguity
    Semantic ambiguity
    Pragmatic ambiguity

    View Slide

  8. 8 Build Software to Test Software
    exactpro.com
    3.3.1 Lexical Ambiguity
    Lexical ambiguity – a word has several meanings.
    Homonymy – different words have the same written and
    phonetic representation, but unrelated meanings and different
    etymologies, i.e., different histories of development.
    Bank (riverside, financial institution), dull (boring, idle), etc.
    Polysemy – a word has several related meanings but one etymology. Systematic polysemy
    occurs when the reason for the polysemy is confusion between classes, e.g., between unit and
    type, and between process and product [16].
    Unit-vs.-type ambiguity - I like this jacket.
    Process-vs.-product ambiguity occurs with everyday words like building, shot, and writing.
    Behavior-vs.-disposition ambiguity. - This is a fast car.

    View Slide

  9. 9 Build Software to Test Software
    exactpro.com
    3.3.2 Syntactic Ambiguity
    Syntactic ambiguity, also called structural ambiguity, occurs
    when a given sequence of words can be given more than
    one grammatical structure = a sentence has more than one parse.
    1. Analytical ambiguity occurs when the role of the constituents within a phrase or
    sentence is ambiguous.
    The Tibetan history teacher.
    2. Attachment ambiguity occurs when a particular syntactic
    constituent of a sentence, such as a prepositional phrase
    or a relative clause, can be legally attached to two parts of
    a sentence.
    The police shot the rioters with guns.

    View Slide

  10. 10 Build Software to Test Software
    exactpro.com
    Syntactic Ambiguity (c’ed)
    3. Coordination ambiguity occurs
    1. when more than one conjunction, and or or,
    is used in a sentence (I saw Peter and Paul and Mary) or
    2. when one conjunction is used with a modifier (young man and woman).
    4. Elliptical ambiguity occurs when it is not certain
    whether or not a sentence contains an ellipsis.
    Perot knows a richer man than Trump.

    View Slide

  11. 11 Build Software to Test Software
    exactpro.com
    3.3.3 Semantic Ambiguity
    Semantic ambiguity – a sentence has more than one way of
    reading it within its context although it contains no lexical or
    structural ambiguity. Ambiguity with respect to the logical form,
    usually expressed in predicate logic, of a sentence.
    Semantic ambiguity can be caused by:
    1. coordination ambiguity,
    2. referential ambiguity, and
    3. scope ambiguity.
    Scope ambiguity
    The quantifier operators include such words as every, each, all, some, several, a, etc., and the
    negation operators include not.
    All linguists prefer a theory.
    No one has seen a pig with wings.

    View Slide

  12. 12 Build Software to Test Software
    exactpro.com
    3.3.4 Pragmatic Ambiguity
    Pragmatics is the study of the relations between language
    and context.
    Referential ambiguity
    The trucks shall treat the roads before they freeze.
    Ellipsis
    ... If the ATM accepts the card, the user enters the PIN. If not, the card is rejected.
    Deictic ambiguity
    Every student thinks she is a genius.

    View Slide

  13. 13 Build Software to Test Software
    exactpro.com
    3.3.5 Vagueness and Generality
    Generality
    Sue is visiting her cousin.
    We finally reached the bank.
    Vagueness
    A requirement is vague if it is not clear how to measure whether the requirement is fulfilled or
    not. A non-functional requirement, e.g., fast response time, is often vague, because there is no
    precise way of describing and measuring it, short of arbitrary quantification, which leaves us
    wondering if the essence of the requirements have been captured.
    The only difference between vagueness and generality is the existence of borderline cases.

    View Slide

  14. 14 Build Software to Test Software
    exactpro.com
    3.3.6 Language Error
    A language error ambiguity occurs when a grammatical,
    punctuation, word choice, or other mistake in using the
    language of discourse leads to text that is interpreted by
    a receiver as having a meaning
    other than that intended by the
    sender.
    Every light has their switch.
    Everybody brings their lunch.
    All lights have their switch.
    All lights share their switch.
    Each light has its own switch.

    View Slide

  15. 15 Build Software to Test Software
    exactpro.com
    Interim summary
    - Section 1 - Intro & nature and sources of ambiguity
    - Section 2 - Requirements vs legal texts
    - Section 3 - Types of ambiguity:
    Linguistic ambiguity
    Generality and
    vagueness
    Syntactic
    ambiguity
    Semantic
    ambiguity
    Pragmatic
    ambiguity
    Lexical
    ambiguity
    Language error

    View Slide

  16. 16 Build Software to Test Software
    exactpro.com
    4 - Techniques for Dealing with Ambiguity
    Three groups according to the requirements engineering activities:
    - Requirements elicitation
    - Requirements documentation
    - Requirements validation

    View Slide

  17. 17 Build Software to Test Software
    exactpro.com
    Requirements elicitation
    For requirements elicitation, at least two strategies can be distinguished to
    minimize ambiguity:
    - First, a context must be established, because language is interpreted always in
    context, and if this context is not made explicit and agreed to by all the
    stakeholders in an elicitation session, misinterpretations are likely.
    - Second, the requirement engineer’s paraphrasing what she understood from
    the customers’ and users’ statements in her own words is an effective way for
    the requirements engineer to get the customers and users to spot their own
    ambiguities.

    View Slide

  18. 18 Build Software to Test Software
    exactpro.com
    Requirements documentation
    For requirements documentation, at least three strategies can be distinguished to
    avoid ambiguity:
    - Increasing the precision of natural language
    Glossaries, style guides, sentence patterns, and controlled languages;
    - Providing more context information
    Comments, rationales, fit criteria, test cases, inverse requirements, and
    traceability information
    - Setting up conventions for interpretation

    View Slide

  19. 19 Build Software to Test Software
    exactpro.com
    Requirements validation
    For requirements validation, at least four strategies can be distinguished to detect
    ambiguity:
    - Formalization of informal requirements
    - Searching for particular patterns of ambiguity
    - Comparing the interpretations of a document by different stakeholders
    - Сommunicating an interpretation back to the requirements author, after which
    she can easily point out misinterpretations.

    View Slide

  20. 20 Build Software to Test Software
    exactpro.com
    5 - Avoiding Ambiguities in Natural Language
    Specifications and Contracts
    This section covers a variety of common linguistic, lexical, structural, scope, referential, and
    language-error ambiguities that appear in both requirements specifications and legal
    contracts.
    In each case, we
    1. give a succinct example of a general problem,
    2. give common solutions to the general problem, applied to the succinct example,
    3. describe drawbacks of the common solutions,
    4. offer a correct solution to the general problem, again applied to the succinct example.

    View Slide

  21. 21 Build Software to Test Software
    exactpro.com
    Ambiguous, Vague, and Uncertain Words
    and, any, or
    after, before, next, previous, etc.
    minimum and maximum
    a large number of adjectives and adverbs: acceptable, accurate, appropriate, easy, efficient,
    essential, immediately, minimum, maximum, periodically, sufficient, user-friendly, etc.
    also verbs and nouns can be vague: support, handle, process, reject, use, etc. and user.
    uncertainty is expressed using words such as not limited to, etc., can, may, probably,
    possibly, usually, etc.

    View Slide

  22. 22 Build Software to Test Software
    exactpro.com
    Quantification
    all, each, every
    a, all, any, each one, some, and the as quantifiers
    many and few
    only, also, others
    even

    View Slide

  23. 23 Build Software to Test Software
    exactpro.com
    Structural ambiguity
    - Adjectives and other modifiers: English grammar teacher
    English, i.e., British, teacher of grammar, not necessarily English grammar
    teacher of English grammar, with the teacher’s nationality left unspecified
    - Pronoun references: Bob said to Joe that he must leave
    - This and Whole Ideas: this that refers to a whole idea vs. this referring to a specific noun
    - Otherwise
    - Not
    - Not and because
    - And and or in the same sentence

    View Slide

  24. 24 Build Software to Test Software
    exactpro.com
    Parallelism
    - Assumed parallelism:
    Shoes must be worn. Dogs must be carried.
    - Than and Different From and Parallelism:
    Cleveland is closer to Philadelphia than New York.
    The method used for coding is different from structuring.

    View Slide

  25. 25 Build Software to Test Software
    exactpro.com
    Other things
    - Quoted Word vs. Denotation
    - Time Expressions
    - Ambiguity Even in Formalism!!!

    View Slide

  26. 26 Build Software to Test Software
    exactpro.com
    6 - Examples
    Technical specifications:
    Legal documents:

    View Slide

  27. 27 Build Software to Test Software
    exactpro.com
    7 - Writing guides
    - General writing
    - Technical writing
    - Requirements specification writing
    - Legal document writing
    - Guidelines on avoiding and finding ambiguities

    View Slide

  28. 28 Build Software to Test Software
    exactpro.com
    8 - Conclusion
    Even with all the systematic techniques and modeling, avoiding and detecting ambiguities
    is at best an art.
    Fundamentally and ultimately, an ambiguity is anything that causes different people to
    understand differently; unfortunately, the set of people that happen to examine a document
    may just not have a person that detects an understanding that demonstrates an ambiguity.
    Therefore, it will be necessary to improve our skills at avoiding and detecting ambiguities.
    We need to teach lawyers and requirements engineers to write unambiguously.
    We need to teach lawyers and requirements engineers to spot hidden ambiguities.

    View Slide

  29. 29 Build Software to Test Software
    exactpro.com
    Takeaways
    Applicability
    - Types of ambiguity (what to expect from the text written in natural language)
    - Techniques to deal with ambiguity (metatextual components of documentation)
    - Techniques to avoid ambiguity (inventorization of typically “weak” places)
    Assessment of the task ahead
    - Multiple linguistic levels
    - “Artistic” nature of the skill needed for the task

    View Slide

  30. 30 Build Software to Test Software
    exactpro.com
    Thank you!

    View Slide