Software testing (Week 10) Flashcards
What is a bug?
A software bug occurs when at least one
of these rules is true
• The software does not do something that the specification says it should do. • The software does something that the specification says it should not do. • The software does something that the specification does not mention. • The software does not do something that the product specification does not mention but should.
What are the goals of testing?
To demonstrate to the developer and the customer that the software meets its requirements
- at least one test for every requirement
- tests for each feature as well as combinations of features
To discover situations in which the behaviour of the software is incorrect, undesirable or does not conform to its specification
- discover undesirable system behaviour such as system crashes, unwanted interactions with other systems, incorrect computations and data corruption
What are the software testing axioms?
It is impossible to test a program completely
Testing cannot show the absence of bugs
Not all bugs found will be fixed
It is difficult to say when a bug is indeed a bug
Specifications are never final
Why is it impossible to test most programs completely?
The only way to be absolutely sure software works is to run it against all possible inputs and observe all of its outputs
What is verification?
Check against the specification whether the product is built right
What is validation?
Check against the user requirements whether the product is built right
What is the V-model?
The V model of testing was developed where for every phase, in the software development life cycle (SDLC) there is a corresponding testing phase
The V model is an extension of ‘plan-based’ development methodologies, such as the waterfall model
- unlike the waterfall model, in the V-model, there is a corresponding testing phase for each software development phase
- At each stage of the SDLC, test cases are produced to be applied to the software
V-model vs Agile development
V-model is very difficult to apply to an agile methodology
However, some principles are common between the two, eg:
- Kill bugs at their source
- Agile best practise is to address bugs in the iteration they are discovered
- ‘Phase containment’ in v-model - remove defects at their point of introduction
Acceptance criteria
- user stories (agile) and requirements (v-model) both include acceptance criteria. i.e what will be tested, how can they be successful
What is unit testing?
Process of testing individual components in isolation
- test driven development creates tests before the code
Units could be individual functions, classes or components with well defined interfaces
Purpose to validate that each unit of software performs as it was designed
‘linter’ - types of tools that assess code for bugs, errors, inconsistencies, etc - before it is run/compiled (static code checks)
- useful for interpreted languages, eg: python
What does complete test coverage of a class involve? (unit testing)
Testing all operations associated with an object
Setting and interrogating all object attributes
Inheritance makes it more difficult to design object class tests as the information to be tested is not localised - parent/child class operations may need to be considered
Test normal operation of the object/function/component
test abnormal input to see if it is handled correctly
What is Equivalence Partitioning/Boundary Value anaysis?
It is a type of black box testing technique that can be applied to all levels of testing
- reduce range of inputs to ranges or classes
- one test chase is chosen from each class
- Reduces total number of test cases to be more manageable
- Eg: Software accepts inputs between 1-1000
- Divides this into 3 classes (above,below,within)
What is BVA (Boundary Value Analysis)?
Type of testing
- many errors occur at boundaries or extremes of input values, Test extreme values and boundaries