FX Flashcards
What is software verification?
ensure that the actual implementation meets the requirements set forth at the beginning
The main thrust of Software Engineering II is on Testing. If you had to hazard a guess, which of the five phases above do you think Testing falls into?
If you answered Verification you would be correct. But if you think Verification is something that happens after all the other phases are complete, you would be incorrect. Other than the Requirements phase, testing can play a crucial role throughout the software development process.
What is unit testing?
Unit Testing is when individual units of the software are tested…
What is a failure?
Failure - a deviation from the expected behavior
These failures occur because there exists a “bug” in the code (a fault).
What is the a fault
Fault: - an instance of incorrect code that can lead to a failure
A fault is introduced to the program when a programmer makes a mistake (an error).
What is a error?
Error - a mistake that introduces a fault (e.g. typo and conceptual misunderstanding)
Functional Testing
These types of tests are used to verify that the software meets the requirement specifications when it comes to functionality; does the software do the things it is expected to do?
Examples:
Does clicking “save” actually save the changes to the hard drive?
Does the search algorithm actually find the shortest path?
Does the isItPrime function correctly identify prime numbers?
Does the database correctly supply responses to the client?
Non-functional Testing
These types of tests are used to verify that the software performs at the required levels. This can literally mean performance, but also usability, reliability, and robustness.
Examples
Does the webpage load in less than 2 seconds?
Does the interface provide enough clues for easy navigation?
Does the system successfully recover from a catastrophic failure?
Does the service support 10,000+ active users at a time?
You are interested in learning how user friendly your software is.
Manual - This type of task really requires a human to interact with the software.
Scenarios 2: You want to make sure your new changes didn’t break your existing features
Automated or Manual
Automated - Using pre-written tests that were known to pass, you can quickly verify that your changes didn’t cause any of them to fail. This is called Regression Testing.
Scenarios 3: You want to test for game breaking bugs in a massively online multiplayer game.
Manual While automated tests could be used to test components of the game, testing the combined product really requires humans actively trying to break the game while it is running.
Scenarios 4: You want to verify your system can handle a large range of possible inputs.
Automated - Instead of having a human try to input thousands of possible inputs, automated tests can randomly generate inputs in a fraction of the time. This is called Random Testing.
When is black box testing useful?
Black Box Testing is when you write tests based purely on the description provided for the software (a.k.a. the specification).
What are the limitations of black box testing?
It isn’t possible to test every possible input, so tests may miss logic branches/program paths untested (more on this in the White Box module)
There is no way to know why the failure occurs, just that the failure indicates a fault
Poorly written specifications can lead to inaccurate tests
Random Testing - Advantages
Advantages
Quick to write
Can cover large portions of the input domain with very little code
Tests have no bias
Can potentially generate an input that no one considered
Random Testing Disadvantages
Many random inputs could fall under the same “test case”, so become redundant and a waste of resources
May not test the tricky parts of the input domain like edge cases
Without any targeting, random inputs could easily miss glaring errors
Randomly selecting inputs for each test run could see some runs pass while others fail
How does Partition Testing improve a testing suite?
partition Method is a way of reducing the potentially thousands of different combinations of testable features (i.e. test cases) down to a number that can be realistically implemented.
When is white box testing useful?
White box testing focuses on verifying that all the code works as intended by trying to have as much of it run as possible during testing. This is done through something called coverage.
Definition Time
Code coverage is the extent to which a given test suite executes the source code of the software.
Why is 100% statement coverage not enough?
All the non-executed statements are inside conditionals that aren’t triggered:
Do you think 100% branch coverage means 100% statement coverage? Why?
100% branch coverage guarantees 100% statement coverage. In this way we can say branch coverage subsumes statement coverage.
What is the input domain for my_abs?
def my_abs(val): if(val > 0): return val else return -val
Answer-The input domain consists of all real numbers!