Você está na página 1de 9

I N T E R N A T I O N A L C O N T R I B U T O R

Testing Times in
Computer Validation
Ian Lucas
SeerPharma Pty Ltd.

ith so much written and ers all aspects of that assertion.

W talked about the different


phases of testing, it is
easy to become confused about what
❝The
fundamental
objective of
The next section describes how
paragraphs on testing are generally
written and expanded upon in pro-
constitutes the ‘correct’ amount of ject documentation.
testing for any specific application or testing is to At the highest level ‘Overall Test
implementation. This article at- Objective’ stage, the purpose is al-
tempts to simplify some of the many prove some most always correct (e.g., show that
testing terms, and provide some assertion. This system X works as described in the re-
practical guidance in performing ef- quirements specification). At this
fective testing. The advice offered is sounds so stage, objectives are very generic, so
focused on process control/automated obvious as to anything that conveys the general idea
manufacturing systems, but is also ap- of implementing a quality system can
plicable to other computerized sys- be silly , but the be construed as correct.
tems. biggest cause At the next level down, the ‘test
As with all aspects of computer cases’ stage, test objectives are again
validation, a basic knowledge of the of ineffective fairly generic (e.g., show that the
theory must be understood before testing I have user security system works as ex-
testing can be effective. Although pected). At this stage, errors are usu-
this article is a personal viewpoint, I seen is the loss ally not found in what is written, but
have included several document ref- of clarity of this rather what is not. A common cause
erences for further guidance on the for test omissions is to write the
subject. objective. ❞ cases based on the programs to test,
The fundamental objective of test- rather than the functions to test. This
ing is to prove some assertion. This sounds so obvious then leads to an almost one-to-one mapping between
as to be silly, but the biggest cause of ineffective test- programs and tests, and makes the testing easier to
ing I have seen is the loss of clarity of this objective. perform from a testing point of view. Unfortunately,
People lose focus about what they are trying to prove, from the project point of view, the idea is not to make
or only superficially test assertions. It is always easier the testing easier, but to ensure as much effective test-
to test what is expected than what is not. The reason ing of the critical areas of the system is tested in the
why users can find problems in systems that are not time provided.
found during defined testing times is that they are not From the test cases, the test scripts are written.
restricted to a defined set of test data to use. These describe the actual actions to perform, and the
We need to ensure that we are clear on what we expected results that should be observed to prove the
are trying to prove, and that our test data truly cov- intent of the case. There is a real skill required to be

February 2003 • Volume 9, Number 2 153


Ian Lucas

able to write these, so that the correct emphasis is hensive testing coverage.
placed on the intent of the case, rather than the periph- (Note that in the interest of not over complicating
eral actions required to set-up the case. this paper, I have not added the documents created on
There is also a skill required in asking the tester to the left side of this diagram. Varying requirement spec-
produce, annotate, and verify hard copy attachments ifications and designs can be on both the USER and
that form ‘defendable proof’for that case (without pro- SUPPLIER sides, depending upon whether a product
ducing attachments simply for the sake of documenta- or custom solution is being developed.)
tion). There will be more information on this topic in
the Journal of Validation Technology at a later date. The Supplier Testing
Even with a clarity of focus on the test objectives
for a single test exercise, it is easy to lose focus as to Unit Testing
where that exercise sits in relation to the total project. For systems where new code is developed, ‘Unit
This can be due to the high number of testing terms, Testing’ is used to provide structural (also referred to
and where they all fit in relation to each other. It is also as ‘white box’) testing of this code. This involves
attributable to the fact that many people’s definitions checking that the code has been written to defined cod-
of these terms are different than other individuals. ing standards, that the code reflects the design (usual-
Included are my definitions and general testing ly the pseudo code process specifications), and varying
philosophies below to assist with the understanding of degrees of stand-alone module performance checks.
the examples supplied. These need to fit the criticality of the module, and
As a general rule, I’m an advocate of the ‘X’ model involve input/output parameter checking and
(GAMP 3)1 of system development and testing (see branch/code coverage. Note that for this testing there
Figure 1). This takes into account that systems are de- is an assumption that the design is correct as approved
veloped and tested (to varying degrees) in conditions for development (a costly assumption in some cases).
away from their final environment. As this testing is usually performed by another
The overall testing exercise therefore covers both en- developer, emphasis is placed on the technical aspects,
vironments, with common sense and experience being rather than the functional aspects. However, it must be
used to determine the amount of testing being per- noted that additional code cannot magically appear in
formed in each sub phase for each individual project. the executable program after the source code is writ-
The aim is to minimize the duplication of testing ten. It is therefore, imperative, that the coder add a
throughout the phases, and to use each sub phase to detailed level of implicit ‘safety-net’ (my definition)
build upon the previous phases to provide compre- code, as well as the explicit ‘requirements’code.

Figure 1
System Development and Testing
USER (Final Environment) Performance Qualification/User Acceptance Testing

SAT Operational Qualification

Installation Qualification/Installation
Testing
Supplier (Development Environment) Customer Acceptance Testing

System Testing FAT

Unit Testing

154 Journal of Validation Technology


Ian Lucas

Without going into an overly technical explana- ensure that they have performed these code reviews on
tion, please refer to Figure 2, which is the following their products. As mentioned before, functional testing
two pseudo-code listings. Both describe the process cannot put this safety net back in – only show that it is
for summing a set of numbers, working out their aver- not there.
age, and then saving the information in a data table.
Unit Integration Testing – A Link Between Unit and
Figure 2 System Testing
Pseudo-Code Listings Describing For complex systems, a level of testing of some of
the integrated software modules may be warranted.
the Sum Process and Averages This may involve writing software shell ‘driver’ pro-
Listing One Listing Two grams, and calling up several modules to test flow and
Set Sum = 0, Count = 0 Set Sum = 0, Count = 0 control between these modules.
While not exit selected While not exit selected Note that this control will be tested again during
Read Number Read Number system testing, and should only be performed if the
If input not numeric jump between a single unit test and full functional test-
Report error, and do ing is considered a substantial risk.
not add/increment
Add Number to sum Add Number to sum System Testing
Increment count Increment count The supplier ‘system testing’is where the system
End while End while is functionally put through its paces. As well as the
If count = 0 standard expected operational tests, other stress tests
Report message, and should be devised. These include:
do not calculate total or
store
• Power Tests – think about the most inopportune
Set average = Sum/count Set average = Sum/count
times to lose power on the system and try these
Store average in data table Store average in data table • Time – if applicable, wind back and forward the
If store fails, Report time on the server and client Personal Computers
error
(PCs) to simulate daylight savings time
The design pseudo-code may not explicitly have • Status Transitions – look for processes that use sta-
the bold lines in the Listing Two described, but it is im- tus’to determine operation, and check that these
portant that the code review pick up that a level of this cannot deadlock the process. I have seen several
‘safety-net’ code has been written. processes where a product/batch had to be in sta-
For the above example, a typical functional test may tus Ato initiate the process, moved to status B dur-
be to run two or three sets of standard data through the ing the process, then finished with status C. The
algorithm, and check the expected result against the problem was that if the process failed in process B,
one in the database. Note that both sets of codes would there was no way to restart or finish that process
pass this test. It would only be when non-numeric data, on that product/batch.
no data, or when a problem with the database occurred,
that the code generated from Listing Two would show Amajor difference between system testing (also read
its robustness over Listing One. OQ) and customer/user acceptance testing (also read
The above example is a little contrived, but the PQ) is that system testing is not just trying to show the
point is that in a large system many of these ‘safety- system does what it is designed to do from the specifi-
net’ checks will not be tested (as time is given to test- cations – it is also trying to find errors.
ing the expected paths). The robustness of the system There is a fundamental mindset change between
only comes out over time, as inadvertently, unexpect- these two objectives that has not been captured in most
ed data or situations are encountered. guideline reference material. Take most V-model dia-
This highlights the importance of unit testing, and grams (see Figure 4) that associate requirements and
auditing the developers of critical software products to design documents to the different testing phases. The

February 2003 • Volume 9, Number 2 155


Ian Lucas

common thread is that tests can ONLY be written that will cause unexpected results, these are best picked
against requirements documented in those specifica- up (in the development environment) in the unit testing
tions. We are also constantly told that all testing must (by another developer) or in supplier system testing.
be planned before being performed. A more relevant V-model diagram (although less
Both of these philosophies are contributing to test- aesthetic) would resemble Figure 4.
ing not being as effective as it should be.
There needs to be a realization that some tests need Figure 4
to ‘think outside the specification.’ In Figure 3, a V-Model Diagram
computerized system is pictorially represented as sets
URS UAT/PQ
of requirements and actions.
Figure 3
FS System
Requirements and Actions testing/OQ
Computerized System Pictorial Implicit Destructive
Requirements Testing

Design Unit
Key: Testing
FS: Functional
Actions not Specification Coding
Explicitly Unlikely UAT: User Acceptance
Explicit System
Described Actions Testing
Requirements
but Likely, URS: User Requirements
to Occur Specification

In this destructive testing phase (which is really a


sub phase of system testing), tests would mainly be de-
veloped from common sense and experience. Guide-
lines should be developed to aid inexperienced per-
Almost all testing is quite naturally focused on the sonnel in areas to consider. Other tests also need to be
inner ellipse. If users always acted exactly as expect- developed by looking at common problems associated
ed, this would be fine. However, over a system’s life, with the following areas, including:
‘actions not explicitly described but likely to occur,’
most probably will. Actions including: • The software development tool (if known)
• The product itself
• Non-numeric values where numbers are requested • The customer site
• Escape, control, function, and ALT characters • Interfaces to the system
pressed when not expected
• Opening and using windows out of sequence The idea of this testing is not to follow a structured
• Running multiple unexpected processes at the same plan, but to purposely try to find errors. All tests and re-
time sults must be documented, and it will be up to the dis-
• Not entering mandatory data cretion of the project/validation team afterwards to re-
• Data files/tables growing larger than expected view each issue to determine the likelihood of the pro-
blem occurring, the risk if it does, and the cost of the
These actions cannot be stopped – only mitigated rectification.
by performing expected reactions when they occur.
Note that the perfect system is not one where the Customer Acceptance Testing
tester has thought of all these unspecified actions, Prior to a system being installed in the live environ-
but where the developer has. ment, the actual users should check that they are indeed
Given that almost all computerized systems have receiving what they expect. This level of testing (and to
some degree of actions not specified in the requirements varying degrees, the system testing) is often called the

156 Journal of Validation Technology


Ian Lucas

Factory Acceptance Test (FAT) for process control sys- ply entering data as instructed.
tems. ❷ Even with an experienced tester, the emphasis is
A set of tests should be developed from the require- placed on reading the many instructions and per-
ments documents that test the system running through a forming each step, with many more expected re-
typical process flow in chronological order. To obtain sults than is really necessary. It is not always
the maximum benefit out of this testing, both the writing clear which action is significant, and which are
of the protocols and the performing of the testing should only there to prepare for a significant step.
be conducted by different personnel than those who per-
formed the system testing. However, the system testing Another problem that can make the testing less ef-
results and report should be reviewed prior to customer fective is to ask for too many hard copy print outs.
acceptance testing to ensure that testing time is not being These form important test result evidence when request-
wasted in simply reperforming previous tests. ed (and annotated) correctly, but can add unnecessary
Keep in mind that each testing exercise needs to time and effort when requested at each test step. Each
be as comprehensive or narrow as deemed appropri- print out takes time to physically produce, collect, col-
ate for the risk of the system. late, annotate, and review.
For a purchased product where extensive system Also, from an auditor’s point of view, producing un-
testing cannot be guaranteed, a full set of customer necessary output shows that the testing team is not cer-
acceptance tests may be warranted; whereas for a cus- tain what the critical control points in the process are.
tom developed solution where detailed unit, system Generally, it is better to give the clear intent of the
and destructive testing have occurred, a reduced cus- test with the expected result, and only aim to give as
tomer acceptance testing may be acceptable. many explicit actions as is truly necessary. Of course,
there will always be situations where more detail is nec-
The Testing Exercise essary (e.g., regression test suites where the aim is to run
In all stages of testing, the exercise can only be as ef- a known set of data through a previously tested process
fective as the protocols developed, and the skill and to ensure that it still operates as it formerly did).
attentiveness of the tester. The ability to hypothesize and
observe the entire system environment, whilst testing Annotating Printouts
specific assertions is a valuable asset in any testing team.
The idea is to not only look for the obvious expected re- Many testers fall at the last hurdle when it comes
sult, but to be ready for the obscure discrepancies. to tying up the test results. There are many formats for
In developing protocols, a common question is “how the test scripts, but they should minimally contain:
detailed does the test step description text (also refer-
red to as ‘actions’ text) need to be?” • Intent – what the test is trying to demonstrate
A couple of serious problems arise when the act- • Actions – what actions need to be performed to
ions are made too detailed (e.g., place the cursor over show the intent
batch 12345 and press F5 (Select). Enter ‘1.564’in the • Expected Result – what constitutes acceptance of
Weight field and ‘Acceptable’ in the Pass/Fail field. the intent
Press F5 (Continue), then F7 (Update), etc): • Actual Result – what actually happened. There
should be room provided to note an incident or
❶ To write the actions, the protocol developer usu- anomaly number, and to reference hard copy print-
ally has to actually run the product with the test outs (if requested)
data to see what happens. If the tester then re- • Pass or Fail – does the actual result either match the
peats these actions during testing, this is not in- expected result, or can it be explained as to why it
dependent testing, but simply confirming what doesn’t match, but can still be deemed as a pass
the test developer did. In this way, the test devel- • Signature, date, and time
oper can sway the tester in the performance of
the testing. It also totally removes any testing in An example is shown in Figure 5. Note that log
the ease of use of the system as the tester is sim- files can sometimes be hundreds of pages long. To

February 2003 • Volume 9, Number 2 157


Ian Lucas

simply print this, and include it as an attachment to • Downtime of critical business processes
the completed test scripts does not automatically show
obvious success. As well as annotating a two-way ref- From this, it is clear that an installation plan (and
erence between the test and the output, all relevant subsequent Installation Qualification [IQ]) is vital to
statements on the print out should be highlighted, ini- ensure that the system configuration tested in the devel-
tialed, and dated, and reasons written why the state- opment environment is the same system to be commis-
ment should be accepted as proof or rejected. For an sioned in the live environment. Without this assurance,
example, see Figure 6. the case for using assertions proved in the development
Note that if follow-up actions are required as part environment to minimize testing in the live environ-
of output justification, additional attachments (cor- ment declines.
rectly annotated back to the original document) will be Remember, effective testing relies on building the
required for completeness. When reviewed (by an inde- overall validation package throughout the layers of
pendent reviewer), all outputs should also be signed and testing.
dated to complete the ‘defendable proof’ package.
Another method of recording test results is to use a Qualifying the System
tester and a witness whilst testing, and not produce hard There has always been much discussion about what
copy output. Although this may reduce the overall test- activities should be in the qualifying phase of a sys-
ing and review time, it does prevent further independent tem. Statements such as ‘all IQ activities should be
review, and is less defendable, should issues arise later. performed with the power off’ may be true for many
As mentioned before, a combination of both meth- cases, but there would be few software installation
ods (with hard copy outputs limited to critical con- checks using that philosophy.
trol/decision points) is best. I believe it doesn’t matter whether activities occur
in your IQ, Operational Qualification (OQ), or Perfor-
Installing the Software in mance Qualification (PQ), as long as they are done.
the Live Environment For some systems (especially control systems),
qualifying the total solution will involve many indi-
Once the FAT has been approved, the system is vidual qualifications. For example, the physical hard-
ready to be commissioned and qualified in the live en- ware, operating system, database, and application may
vironment. For most implementations, this is more all be installed separately. It is important to get the or-
than just physically moving the test environment. It der and timing of these correct to again build on pre-
may involve: vious assertions.

• Running two systems in parallel Installation Qualification


• Decommissioning the current system to implement If the actual installation plan has been written and
the new one performed correctly, the actual IQ should be a fairly
• Moving current live data to the new system simple exercise. The intent of the IQ is to prove that the
• A defined time period in which to work system has been installed as per the developer’s instruc-
• Coordinating multiple activities and disciplines tions. This includes:

Figure 5
Annotating Printout
Intent: To prove that the standard import feature can import an export file successfully.
Test Actions Expected Actual Pass Signature Date
Number Fail Time
4.5 Use the import feature Data imports without Log file name:_________
to load the export errors. All duplicate Attachment no.:_______
file into the database. records can be
Note the log file name, explained. Incident no.:__________
print it out, and review.

158 Journal of Validation Technology


Ian Lucas

Figure 6
Log File Example

• Proving the right product has been installed (ser- From the above criteria, you can see how many IQs
ial numbers, software versions, etc.) are checklists to indicate that the environment has been
• Proving the product has been installed correctly. set-up before performing application dependent checks.
Although it may be a fairly subjective decision, Operational Qualification
the idea is to perform the minimum of checks to The intent of the OQ is to push the system process-
give enough confidence to continue to the more es and parameters through as many possible operating
thorough OQ. ranges in the time available. Note that ‘possible’ is a
• Proving that support manuals and Standard Oper- wider range than ‘normal.’
ating Procedures (SOPs) exist (without actually As the finish line (i.e., live production) is usually
executing them) very close by the time OQ is being performed, it is a fact

February 2003 • Volume 9, Number 2 159


Ian Lucas

of life that the system will be much more visible to the If confidence is high after OQ, PQ is sometimes
greater user community, (especially senior manage- performed on ‘live’ batches. These batches are obvi-
ment), and the commercial pressure will be on to mini- ously more keenly scrutinized, and their output/results
mize this OQ time. kept to form the PQ results.
This emphasizes why as much stress testing that
can be performed during system testing (even if real- Conclusion
istic simulations are used) is so valuable later in the
project. In conclusion, the testing exercise on any system is
For process control systems, some or all of the IQ no different to any other area of computer validation.
and OQ can be combined and called the Site Accep- That is, there is no simple ‘cook book’ on how much
tance Test (SAT). As these systems involve physical to do, or what approach to take. The points made in
hardware, cabling, Programmable Logic Controllers this article are intended to show that there is no sub-
(PLCs), Supervisory Control and Data Acquisition stitute for well constructed code that simply and intu-
(SCADA) or Distributed Control System (DCS), and itively performs the requirements of the user.
potentially Manufacturing Execution System (MES) Testing does nothing to change this. It only shows
software, there may be a combination of several OQs or disproves this aim.
or SATs to perform. For such complex systems, it is For all future systems, more effort should be made
important to be able to clearly show how all these at this debugging and unit testing level, that will in turn,
tests and qualifications mesh together to allow a simplify testing by providing a more reliable base to
qualified person to declare the system fit for delivery work from. Disciplines that may assist in this area
to the user department. include:

Performance Qualification • Questioning at all phases of the project to force


The PQ (sometimes referred to as User Acceptance clarification of requirements as early as possi-
Testing) is normally the qualification where both the ble
process and the automation are tested as one. I like to • Hypothesizing adverse actions and events and dis-
refer to this stage as ‘a typical day in the life of the cussing solutions
system.’Although many systems do not have ‘typi- • Managing tighter control over developers by mak-
cal days,’ the intent is to show the system will work ing them more aware of the implications of their
as the user specified. work
For batch-related systems, a qualification approach
would be to run several batches through the full oper- However, as systems will always be individually
ation of the system to prove a correct and consistent configured for specific applications, the testing phase
result. Although three is a number bandied around, the will always remain a vital component in the total vali-
aim should be three consecutive batches that give cor- dation package. A logical approach needs to be taken
rect and consistent results. If this is not the case, more in developing the overall testing strategy for each sys-
batches should be performed under formal qualifica- tem that best utilizes the time, environment, and avail-
tion conditions until the problems are corrected and able resources. The key points to remember are:
this is the case.
Some of the less obvious tests that should be per- • Construct the overall testing case by building on
formed at this time include: each testing phase in both the development and
live environments
• SOPs and manuals are correctly written for their • Wherever possible, avoid duplicating tests on
purpose assertions already proved
• Spares exist where applicable • Test for both explicit and implicit requirements
• Correct support procedures and Service Level • Keep realigning focus to remain clear on the objec-
Agreements (SLAs) exist to allow the system to go tives
live • Ensure results and attachments are clearly anno-

160 Journal of Validation Technology


Ian Lucas

tated, and form appropriate evidence for docu-


Article Acronym Listing
mented assertions
DCS: Distributed Control System
Only personnel who intimately know the require- FAT: Factory Acceptance Test
ments, and the workings of the computer system, FS: Functional Specification
can truly say how thoroughly a system was tested. IQ: Installation Qualification
Involving these individuals early, together with MES: Manufacturing Execution System
an overall test strategy that uses common sense and OQ: Operational Qualification
creativity, will maximize the effectiveness of testing, PC: Personal Computer
by locating problems earlier in the lifecycle. PLC: Programmable Logic Controller
Good luck in these testing times! ❏ PQ: Performance Qualification
SAT: Site Acceptance Test
SCADA: Supervisory Control and Data
Acquisition
About the Author SLA: Service Level Agreement
Ian Lucas is the Director of SeerPharma Pty Ltd. in SOP: Standard Operating Procedure
Melbourne, Australia. He has over 20 years experi- UAT: User Acceptance Testing
ence as a software developer/manager, and over 13 URS: User Requirement Specification
years experience implementing computerized man-
ufacturing solutions for the pharmaceutical industry.
Lucas assists pharmaceutical companies in Aust-
ralia and Asia in all aspects of computer system
implementation and computer validation require-
ments. He can be reached by phone at 61-3-
98971990, by fax at 61-3-98971984, or by e-mail at
ian.lucas@seerpharma.com.au.

Reference
1. ISPE. GAMP. 3.0. “Appendix 10.” (March) 1998.

Additional Guidance
• Many general software testing references can be
found at www.testingstuff.com
• ISPE. GAMP 4.0. December 2001.
• ANSI/IEEE 829. “Software Testing Documenta-
tion.” 1998.
• ANSI/IEEE 1008. “Standard for Software Unit
Testing.” 1987.
• ISO/IEC 12119. “Information Technology – Soft-
ware Packages – Quality Requirements and Test-
ing. 1994.
• BSI. BS-7925-1. “Software Testing – Vocabulary.”
1998.
• BSI. BS-7925-2. “Standard for Software Compo-
nent Testing.” 1998.

February 2003 • Volume 9, Number 2 161

Você também pode gostar