Technology Specific Testing Methods Flashcards
Explain the concept of testing against theory.
Does the behaviour of a program match cold facts that you may know of beforehand.
Explain the concept of testing against reality
Does the behaviour match observed phenomena that you can confirm.
How should you test a closed source library where the only details you get are header files and printed instructions?
Wrap into a single module and test it.
Use a range of black-box techniques like input partitioning.
A problem is not knowing the internal state variables and how they are allocated and changed.
How can you approach testing a GUI application?
Use models to represent User Interactions. (since GUIs are event driven)
Split testing based on mvc model. Test view, controller and model separately
Look for unguarded inputs (reading code basically)
Use capture and replay automation tools.
- Not always a good idea. What if buttons and screens are removed.
Why is OO code hard to test?
Inheritance means changes to parents have impacts to children.
State means that methods on same object may interact, sequences matter.
One object can have members that are pointers to other objects.
Polymorphism meas that code being called isn’t known at compile-time.
Errors can come from superclasses that you don’t control.
How can we get around some difficulties of testing OO code?
Use the class as the unit and have unit testing (JUnit style) regression tests for it. Use stubs and mocks in place of other classes.
Use a lot of assertions. Check if class in valid state at beginning and end of their method bodies.
How can you go about testing shrinkwrap web apps?
Simple websites are subjected to coverage of graph of links between pages.
Tools like selenium IDE record interactions and check results.
Treat web browser as just another configuration variable.
How can you go about testing a reactive system?
One that depends on it’s environment and in turn the environment is influenced by the system behaviour.
You will first want to fully understand the environment and go about simulating it.
May be really hard in competitive situations where other actors are gonna react to your system’s actions.
How might you go about testing with concurrent systems involved.
Introduced new failure mechanisms (livelock, deadlock, starvation, priority inversion, data corruption.)
Tests parts in isolation and as monothreaded as possible.
Build autotesters that stress test the system
User models to understand how locks are taken and released.
Some tools can be used to detect data races, ThreadSanitizer
What’s a huge problem about concurrency failures?
They are incredibly difficult to trace and reproduce.