Lecture 8 - Software Testing
Lecture 8 - Software Testing
Part 1
Development testing
Test-driven development
Release testing
User testing
A setup part, where you initialize the system with the test
case, namely the inputs and expected outputs.
A call part, where you call the object or method to be
tested.
An assertion part where you compare the result of the
call with the expected result. If the assertion evaluates to
true, the test has been successful if false, then it has
failed.
Automated test with JUnit >
https://www.youtube.com/watch?v=I8XXfgF9GSc
Part 2
Interface misuse
A calling component calls another component and makes an
error in its use of its interface e.g. parameters in the wrong order.
Interface misunderstanding
A calling component embeds assumptions about the behaviour
of the called component which are incorrect.
Timing errors
The called and the calling component operate at different
speeds and out-of-date information is accessed.
Code coverage
Every code segment that you write has at least one associated
test so all code written has at least one test.
Regression testing
A regression test suite is developed incrementally as a program
is developed.
Simplified debugging
When a test fails, it should be obvious where the problem lies.
The newly written code needs to be checked and modified.
System documentation
The tests themselves are a form of documentation that describe
what the code should be doing.
Lecture 8 Software testing 46
Regression testing
Kate is a nurse who specializes in mental health care. One of her responsibilities is to visit
patients at home to check that their treatment is effective and that they are not suffering from
medication side -effects.
On a day for home visits, Kate logs into the MHC-PMS and uses it to print her schedule of home
visits for that day, along with summary information about the patients to be visited. She requests
that the records for these patients be downloaded to her laptop. She is prompted for her key
phrase to encrypt the records on the laptop.
One of the patients that she visits is Jim, who is being treated with medication for depression. Jim
feels that the medication is helping him but believes that it has the side -effect of keeping him
awake at night. Kate looks up Jim’s record and is prompted for her key phrase to decrypt the
record. She checks the drug prescribed and queries its side effects. Sleeplessness is a known
side effect so she notes the problem in Jim’s record and suggests that he visits the clinic to have
his medication changed. He agrees so Kate enters a prompt to call him when she gets back to
the clinic to make an appointment with a physician. She ends the consultation and the system re-
encrypts Jim’s record.
After, finishing her consultations, Kate returns to the clinic and uploads the records of patients
visited to the database. The system generates a call list for Kate of those patients who she has to
contact for follow-up information and make clinic appointments.
Alpha testing
Users of the software work with the development team to test
the software at the developer’s site.
Beta testing
A release of the software is made available to users to allow
them to experiment and to raise problems that they discover with
the system developers.
Acceptance testing
Customers test a system to decide whether or not it is ready to
be accepted from the system developers and deployed in the
customer environment. Primarily for custom systems.