TM354 Flashcards
Causes of software errors [3]
Malleability
Complexity
Size
A good software system is… [6]
Useful Usable Reliable Available Flexible Affordable
Legacy systems are… [8]
Old
Large
Developed using outdated technologies
Implemented in old programming languages
Critical to the business
Changed a number of times since inception
Difficult to understand due to lack of documentation or experience
Therefore difficult to maintain
A module should… [4]
Have low coupling, high cohesion, a well-defined interface and represent a good abstraction
Reuse can improve development in terms of… [4]
Maintainability
Cost
Delivery time
Quality
Development activities [5]
Domain modelling Requirements elicitation + analysis Design Implementation Testing
Traceability
Tracing the history of each requirement from its origin in the problem domain to its fulfillment in the final system.
What will determine the level of traceability?
The chosen development process
The UP advocates which development practices?
Timeboxing
Big risks up front
Early architecture
User involvement
The UP stages [4]
Inception
Elaboration
Construction
Transition
User stories should be… [6]
Independent Negotiable Valuable to users Estimable Testable Small
Difference between business functional requirement and technical solution requirement
Business functional requirement: system authenticates the users.
Technical solution requirement: authenticate users via a password
How to gather Software Functional Requirements
Business processes/events -> Use cases -> Scenarios -> Functional tasks -> Software functional requirements
Non-functional Requirement Types [8]
Look and feel Usability and humanity Performance Operational and environmental Maintainability and support Cultural Legal Security
Performance Fit Criteria [6]
Speed Capacity Safety Accuracy Reliability Availability
Seucirty Fit Criteria [5]
Access Privacy Integrity Audit Immunity
Function and non-functional requirements must have ______ so that they are testable
Fit criteria
Volere template sections [5]
- Project drivers
- Project constraints
- Functional requirements
- Non-functional requirements
- Project issues
Main concepts in a business domain [4]
Resources
Processes
Rules
Goals
Examples of business processes and business rules
Business process: renting a car
Business rule: lowest mileage car always allocated
Use cases are used to capture ______ [1]
Functional requirements
Scenarios are used to ________ [1]
Illustrate the different ways a use case can unfold
Use case description [8]
Identifier + Name Initiator Goal Precondition Postcondition Assumptions Main success scenario
Each step in a use case may correspond to _______
One or more software functional requirements
Each software functional requirements should ______ [3]
Be unambigious
State what the system should do (not how)
Have a fit criterion
Use cases help to _______ [5]
Capture requirements Capture software requirements Plan development Validate the system Narrow down architecture
Use case descriptions help to _________ each use case [4]
Understand the complexity
Determine which actors are involved
Understand the level of risk
Estimate effort to implement
Use case diagrams:
What are Inclusion and Extension?
Are they conditional or unconditional?
Inclusion: Two or more use cases have overlapping functionality that can be factored out as a separate use case. Unconditional.
Extension: A use case has alternative scenarios that demand a variation on the original use case. Conditional.
Use case modelling steps [5]
- Identify the actors
- Analyse the behaviour
- Find common behaviour and variations
- Draw the model to show the actors, use cases and their relationships
- Annotate as you learn more
You should stop prototyping when _______ [1]
When you are not generating new requirements
Difference between use case and user story
A use case describes a business process
A user story is a single, small piece of user functionality
Conceptual class attributes represent _____ [1]
Terms from the domain expert’s vocabulary
Generalisation, specialisation and interfaces are not required during _______
Domain modelling
Express the constraint that a library member’s current loans and past loans must not overlap
context LibraryMember inv:
(pastLoans -> intersection(currentLoans)) -> isEmpty()
Express the constraint that the room that a guest is occupying be part of the hotel that the guest is linked to
context Guest inv:
self.currentRoom.notEmpty() implies self.currentRoom = self.hotel
OCL logical operators [5]
and or xor not implies
OCL operations [14]
c1 -> isEmpty()
c1 -> notEmpty()
c1 -> count()
c1 -> includes(object) c1 -> includesAll(c2) c1 -> any(expression) c1 -> select(expression) c1 -> forAll(expression) c1 -> exists(expression)
s1 = s2 (contains same elements) s1 -> untion(s2) s1 -> intersection(s2) s1 - s2 s2 - s1
DbC helps to relate the requirements to the code by ______ [1]
Providing traceability
A subclass must neither ______ the precondition nor ______ the postcondition of its superclass
strengthen, weaken
Postconditions consist of ______ [3]
Creating/removing objects
Creating/removing links
Modifying attributes
Dynamic modelling helps to decide ______ [1]
Which operations should be allocated to which classes
Communication diagrams emphasise _______.
Sequence diagrams emphasise _________.
Communication diagrams emphasise the sending and receiving of messages.
Sequence diagrams emphasise the ordering of messages.
The responsibility for creating objects should be given to the class that ________ [4]
Aggregates or contains the objects
Uses the object
Maintains the object
Provides initialisation information
When a responsibility involves consolidating information that is distributed among objects, it should be assigned to _______ [1]
The class that has the most information to fulfill it
When can you update the navigability of associations?
Once you have interaction diagrams
The Law of Demeter
An object can send messages to _______ [4]
Objects sent as parameters to the current method
New objects that the object has created in the current method
Objects that it has direct links to (its immediate neighbours)
Itself
Sequence diagram loop syntax
- [i:= 1..12] printReportForMonth()
Difference between defensive programming and DbC
Defensive programming: always check preconditions before processing.
DbC: Assume that precondition has been met
What is the One Central Class strategy?
Advantages [2]
Disadvantages [1]
All UI messages are sent to a single object.
+ Low coupling
+ Good traceability
- Central class can become overloaded
What is the Actor Classes strategy?
Advantage [1]
Disadvantages [2]
All UI messages are sent to objects that correspond to the real-world initiator.
+ System corresponds to real world
- Traceability is more difficult
- A use case may have more than one initiator
What is the Use Cases as Classes strategy?
Advantage [1]
Disadvantage [1]
All UI messages are sent to use case objects, which each have a run() method. e.g. checkerIn.run()
+ Increases usability as changes in workflows/business rules are localised to one class
- Increased coupling as UI communicates with several classes
What are state machine diagrams represent?
What are they used for?
They represent the life histories of objects.
They are used to model software objects receiving messages or real-world objects responding to events
In a state diagram, if an event has consequences beyond a state change these can be modeled as _______ [1]
Actions
State machine actions should only refer to things that the object knows about, including ________ [4]
Its attributes
Its operations
Its links
The parameters of the message it receives
What are entry/exit events on a state machine?
What is their syntax?
Events that take place each time there is a transition into or out of a state, including self-transitions.
entry / setOccupant(aGuest)
exit / removeOccupant()
How can you avoid triggering entry/exit events on a state machine?
What is the syntax?
An internal transition does not involve a change of state.
hotelLimitChanged() / resetAvailableRooms()
When deciding which attributes to include in a state diagram you should consider _______ [1]
Each attribute’s frequency of change
In a state diagram, transitions have _______ [5]
Source state Target state Event trigger (message) Action / action sequence Guard
Reasons to partition a software system [3]
To manage size and complexity
For information hiding
For logical decomposition
Can packages have associations?
No, but a class in one package can have an association with a class in another
In a package diagram, what is the difference between <> and <>?
<> combines the namespaces so that elements in the imported package can be accessed as if in the same package.
<> keeps the namespaces separate, so that identifiers have to be qualified (e.g. Accounts::Transaction).
UML visibility symbols [4]
+ public
- private
# protected
~ package
What is software architecture?
Software architecture is the overall structure of the system, in terms of software components and their relationships.
What is the relationship between architecture and requirements
They should be developed in parallel (twin peaks)
What are the Architecturally Significant Requirements? [4]
Core features
Quality attributes
Constraints
Application environment
What are the architectural views [3]
Logical view
Process view
Deployment view
What does an architectural view represent?
A representation of the system that highlights the concerns of a stakeholder group
Examples of reuse in development [5]
Requirements patterns Analysis patterns Architecture Design patterns Idioms
Architectural styles [9]
Client-server Call-return Layered Peer-to-peer Data flow (pipes and filters) Data-centred Independent components Service Oriented Notification
Client-server architecture: components/connectors
Programs
Requests
Call-return architecture: components/connectors
Programs/objects
Messages
Layered architecture: components/connectors
Services
Service calls
Peer-to-peer architecture: components/connectors
Programs (peers)
Connections
Data-flow architecture: components/connectors
Programs/objects
Services that pipe the data
Data-centred architecture: components/connectors
Database server/client
Database queries
Independent components architecture: components/connectors
Components
Message exchange protocols
Service-oriented architecture: components/connectors
Service providers/consumers
Requests/responses
Notification architecture: components/connectors
Publishers/subscribers
Procedure calls/messages
What are frameworks?
Frameworks consist of a reusable architecture and a set of components that can be slotted into it
What is a product line?
A domain-specific framework incorporating specialist knowledge about a group of closely related systems
Types of design pattern [3]
Creational patterns
Structural patterns
Behavioural patterns
When should the Singleton design pattern be used?
When there should only be one instance of a particular class (e.g. one central class strategy)
When should the Factory design pattern be used?
When object creation and initialisation is complex, changeable or uses information the client may not know
When should the Factory Method design pattern be used?
When the actual classes should be determined at run-time (e.g. config file, late binding)
Component-based development (CBD) aims to ______ [1]
Assemble systems from reusable components
Components have two kinds of interface. What are they and what do they represent?
Required and provided.
They represent the set of assumptions that components make about each other
Components should ______ [3].
They may include ______ [1].
Encapsulate data and operations
Be fully documented and thoroughly tested
Be known to their clients only through their interface
May include NFRs in their specification
Components:
Advantages [4]
Disadvantages [3]
Faster and cheaper development
More reliable and maintainable
May require adapters
May require plumbing
May be inflexible
The Assume-Guarantee contract between components will include _____ [4]
- Pre/Postconditions of all operations in the provided interface.
- The invariants that apply to any publicly visible properties
- The required interface and its assumptions
- Any assumptions about the environment in which it will operate
Software that was not designed as a component can be integrated into a component-based system by _______
Wrapping it with an adapter that providers appropriate interfaces
What is a service?
A service is an abstract description of some business functionality. It is what is provided by a component, but the component itself has been abstracted away
How is a service different from a component? [6]
Platform independent Language independent Location independent Centralised Autonomous Can be stateless
Service types [3] and examples
Utility - currency conversion
Business - check membership application
Coordination - process membership application
SOA development stages [5]
- Design workflow
- Find services
- Select services
- Orchestrate
- Test
Advantages of services [7]
Agile and flexible Less duplication Legacy integration 3rd party service integration Language independence Platform independence Location independence
Quality attribute scenarios - six part model [6]
Source Stimulus Artefact Environment Response Measure
Quality attribute scenarios - performance values
Source: internal/external
Stimulus: periodic/sporadic/bursty/stochastic events
Artefact: system
Environment: normal/overloaded
Response: process stimuli/change level of service
Measure: latency/deadline/throughput/jitter/miss rate/data loss
Quality attribute scenarios - usability values
Source: end users
Stimulus: user wants to learn system features/use system efficiently/minimise impact of errors/feel comfortable
Artefact: system
Environment: setting preferences/using system
Response: supporting learning/supporting efficiency/allowing adaptation/minimising impact of errors/making user comfortable
Measure: task time/no. of errors/no. of problems solved/success rate/user satisfaction/time taken/data lost
Performance tactics: manage demand [3]
Reduce frequency of events
Limit demand
Increase efficiency
Performance tactics: manage resources [3]
Increase resources
Reduce bottenecks
Exploit concurrency
Performance tactics: arbitrate resources [1]
Schedule resources
Performance tactics [3]
Manage demand
Manage resources
Arbitrate resources
Flexibility tactics [4]
Low coupling
High cohension
Keep modules small
Late binding
Assertion mechanisms allow pre/postconditions to _______ [4]
Be checked at run-time
Be turned on/off globally
Be separated from program logic
Indicate their breach
DbC uses _______ [1].
TDD uses _______[1].
DbC uses invariants
TDD uses test cases
How high should quality be, and why?
Sufficiently high, so as to be useful and affordable
Software Quality Factor Categories [3]
Product operation requirements
Product revision requirements
Product transition requirements
Software Quality Factors - Product operation [5]
Correctness Reliability Efficiency Integrity Usability
Software Quality Factors - Product revision [3]
Maintainability
Flexibility
Testability
Software Quality Factors - Product transition [3]
Portability
Reusability
Interoperability
What is the difference between validation and verification?
Verification assumes the requirements are correct and aims to ensure that the system description is self-consistent and that development meets the specification.
Validation focuses on meeting the needs of the stakeholders without assuming that the specification is correct
What is analytical completeness?
Ensuring the completeness of all requirements that have fit criteria
Test-driver Development process [6]
- Decide on a code increment
- Decide on a test
- Write the test
- Run all test (expecting failure)
- Write the code
- Re-run all tests
Benefits of test-driven development [7]
Test coverage Regression testing and early discovery of errors Executable documentation Beneficial effect on design Complements DbC Promotes good code quality Inhibition of 'featuritis'
When might TDD not be applicable? [5]
Applications with databases Multithreaded systems Legacy systems/large components Highly changeable requirements User-interfaces
What does TDD not replace? [3]
User/usability testing
Acceptance testing
Integration testing
DbC method structure [4]
method heading
assert preconditions
method body
assert postconditions
Types of testing [6] (verification/validation)
Unit (verification) Integration (verification) Regression (verification) System (validation) Usability (validation) Acceptance (validation)
Functions of testing [2]
Improving quality by removing errors
Improving confidence by estimating quality
TDD and DbC focus on what type of testing?
Black-box testing
Black-box testing process
- Determine the input space
- Partition the input space into subdomains
- Perform boundary testing on each subdomain
White-box testing process
Identify and test each path through the code
Disadvantages of black-box testing [2]
Tends to suffer from poor coverage
Cannot account for internal state of objects
Disadvantage of white-box testing 1]
Does not reveal missing or incorrect requirements
Software complexity metrics [7]
Lines of code Cyclomatic-complexity Depth of inheritance tree Coupling between objects Number of children Response for a class Weighted methods for a class
The logical view includes ________ [3]
Structural models
Behavioural models
Package diagrams
Visibility modifiers [4]
Public: visible to all classes
Private: visible only to itself
Protected: visible to itself and subclasses
Package: (default) visible to classes in the same package
Primary Software Quality Attributes [4]
Correctness
Usability
Integrity
Maintainability
Design patterns [8]
Adapter MVC Observer Factory Factory Method Singleton Decorator Facade
Writing tests for an operation involves _______ [3]
Setting up a fixture
Invoking the operation
Checking the postconditions
Specifying operations involves _________ [5]
- Matching the signature and return type
- Writing tests
- Running tests (which fail)
- Writing code (fulfilling contract)
- Re-running tests
Compare agile and plan-driven development in terms of requirements change
Agile treats it as inevitable and starts building quickly to discover requirements. Plan-driven attempts to avoid it by having complete requirements before implementing them.
Why is estimation importing in agile development?
Being able to plan increments
Being able to deal with requirements changes
How does requirements documentation differ between agile and plan-driven development?
Agile: requirements documentation is kept to a minimum, is only used to the extent that it helps communication and is often discarded.
Plan-driven: requirements documentation should be comprehensive and forms a contract between developers and customers
What does the logical view of a system describe?
The system’s main functional elements and their interactions (i.e. the services the system must provide users)
How does TDD benefit design? [2]
Testability of design is enforced by the need to write tests before implementing requirements.
Designs that rely on overly complex code will be identified when attempting to write tests for them, and can be reconsidered early.
What problem does the Adapter pattern solve?
A client that cannot use a component because it expects a different interface than the one provided.
What does it mean for a service to be stateless?
The service responds to each request as a ‘one-off’, without retaining any memory of previous requests.
How can agile development help achieve a good software system? [2]
Adapting to change requirements, leading to a flexible and useful system.
Delivery on time, leading to an available system
Benefits of using a standard template for requirements capture [4]
- Saves time repeatedly making decisions about what to record.
- Ensures nothing important is left out.
- Assists communication between developers
- Allows projects to be compared and required reused
Benefits of prototyping [4]
- Helps with the design of the UI.
- Gets users involved, helping to capture and refine requirements.
- Minimise misunderstandings between developers and users
- Early detection of problems
Situations not suited to agile development [5]
Heavily regulated environment
Large software development with distributed teams
Requirements are well-defined and unlikely to change
Customer is distant
Situations suited to agile development [4]
Requirements are constantly changing
Developers and users can communicate regularly
The team is small enough that everyone can participate in a meeting
The developers like being empowered
Write the signature for operation addQtyOfProductToOrder, which takes arguments of type Order, Integer and Product and is sent to the system class Store
context Store:addQtyOfProductToOrder(order: Order, quantity: Integer, product Product) : String
Requirements must be _____ [6]
- Necessary and traceability
- Clear and realistic
- Complete
- Consistent
- Verifiable and validated
- Independent of design