Unit 11 Flashcards
Give two examples of executable documentation.
Unit tests and pre- and post-conditions
What is meant by ‘executable documentation’?
Executable documentation is documentation that allows code to be automatically checked for validity at run time. It should also demonstrate how the code should be used and indicate what the code does.
Suggest three expectations that a customer might have of a software product without perhaps being aware of them.
Three possibilities are:
- the product will not conflict with other software that they use
- the product will boost productivity
- the product will be simple to use
Explain how increasing integrity within a system could affect efficiency.
Increasing integrity within a system means strengthening measures to ensure that modification or deletion of data by unauthorised persons, or by any other unintended means, does not occur. This might involve the use of passwords to access certain data and an authentication server to check a user’s identity, or it might mean that network traffic needs to be encrypted and decrypted. Each of these factors adds an overhead to processing, so efficiency is likely to be reduced.
Identify a pair of software quality factors (SQFs) that are not independent.
Usability and portability. For example, many of the features of the Apple Macintosh that contribute to its reputation for usability are built into its operating system. Applications that take advantage of these features are less portable to other systems, such as Windows or Linux.
What are the four SQFs identified as being of primary importance for everyday software products?
Correctness, integrity, maintainability and usability.
How could you assess correctness?
A popular measure for assessing correctness is defects per thousand lines of code (defects per KLOC), where a defect may be defined as a verified lack of conformance to requirements.
How could you assess integrity?
This is measured by considering the proportion of ‘attacks’ on a product as opposed to bona fide uses.
How could you assess maintainability?
Unfortunately there is no way to measure maintainability directly, and so we must measure it indirectly. A simple measure is mean time to change (MTTC), which is the average of the times it takes to analyse a bug report, design an appropriate modification, implement the change, test it and distribute the change to all users. In general, the lower the MTTC (for equivalent types of changes), the more maintainable the software product is.
How could you assess usability?
Any system with a user interface and that will be used by people other than the developers should be usability tested. Usability testing involves users systematically trying out the user interface and the system behind it – although for some purposes the system may be simulated. There are also forms of evaluation such as heuristic review that can be used to make substantial improvements to user interfaces without involving users.
What is the purpose of verification?
Verification tests the extent to which the product conforms with the various, often evolving, system descriptions designed to help produce it.
What is the purpose of validation?
Validation focuses on ensuring that outputs meet the needs, including implicit needs and expectations of customers and stakeholders.
What tasks does verification involve?
- ensuring that all system descriptions are self-consistent
- ensuring that all system descriptions are consistent and complete with respect to those from which they were derived
What task does validation involve?
- ensuring that all system descriptions are consistent with the customer’s requirements, including implicit requirements
Give a simple example of two system descriptions that might contradict each other.
One example would be if a structural model for a hotel reservation system indicated that a reservation could be made for more than one room but the implementation only allowed one room per reservation.
Why is it important for the customer’s requirements statement to be self consistent?
If the customer’s requirement statement lacks self consistency, then either the resulting system will be inconsistent or it will not satisfy the customer’s requirements. The system builders can decide (implicitly or explicitly) how to resolve the inconsistencies or, if the inconsistent requirements affect different parts of the system and are not picked up by the developers, the developers could inadvertently build the inconsistencies into the product.
Describe three benefits of test-driven development.
- Test coverage: Test coverage is in some respects comprehensive, with virtually all code having associated tests. These tests should all have been run successfully throughout development. Finished code therefore already has an extensive test suite.
- Regression testing and early discovery of errors: Many kinds of error are discovered and corrected at the earliest opportunity. Changes that break tests can be quickly identified and rectified.
- Executable documentation: The tests both show how the code should be used and indicate what it should do by means of test cases.
Describe three limitations of test-driven development.
- User interface: TDD does not readily apply to user interface testing, for which it is better to apply techniques such as usability testing.
- Testing of applications integrated with databases: TDD alone is not adequate for the comprehensive testing of databases.
- Multithreaded systems: TDD is not generally suitable for the testing of multithreaded systems, as results may depend on the vagaries of timing.
Give two reasons why it is useful to run a unit test before the relevant code increment has been written.
- If the test unexpectedly already passes at this point, this demonstrates that it is not a good test of the next increment.
- If it fails in an unexpected way, this demonstrates a faulty or incomplete understanding of the test that needs to be addressed in order to have a good grip on the code and test.
Describe the four distinct categories of testing.
- Requirements-based testing draws on previously gathered or formulated testable requirements to check that a system meets the customer’s requirements. The final stage in this form of testing is acceptance testing.
- Usability testing refers to testing of the user interface.
- Developmental testing is a term that refers to all of the testing carried out by the team developing the software. It is useful to distinguish between developmental testing at three different levels of scope – unit testing, integration or component testing and system testing.
- Regression testing is any form of testing during development or system maintenance that systematically checks that fixing one bug has not introduced others.
Are there any situations in which system testing should be carried out by the implementers of a system?
Probably the only situation where this is appropriate is when the project team is small. In small teams, one person might play the part of requirements engineer, designer, implementer, tester and maintenance engineer.
What do you think is the relationship between system testing and acceptance testing?
In general, the same tests will be carried out during acceptance testing and system testing. System testing is an in-house activity and a customer need never know how system testing went – any bugs can be dealt with before the customer sees them. Acceptance testing, on the other hand, is conducted with much more at stake – the customer can accept or reject a system based on its performance at acceptance testing.
Why should regression testing be necessary even after the customer has accepted the product after acceptance testing?
Acceptance testing is the process of showing that the software meets the customer’s requirements, not that there aren’t bugs in the code. In fact, given that a system is put into use, bugs that require fixing are almost certain to be found after acceptance testing. In addition, the system will be maintained, with functionality added and changed, leading to a requirement for regression testing.
Use the following phrases, which describe four kinds of testing, to fill the gaps in the following three sentences.
usability testing; requirements testing; security testing; regression testing
TDD and DbC are valuable but not comprehensive tools for _________________.
TDD has ________________ built into it.
DbC and TDD cannot substitute for thorough _______________ or _________.
TDD and DbC are valuable but not comprehensive tools for requirements testing.
TDD has regression testing built into it.
DbC and TDD cannot substitute for thorough usability testing or security testing.