Monday, July 26, 2010

Chapter 2 SOME TESTING TERMINOLOGY


Faults - a mistake in the code that causes the software to not behave as expected (causes)

Failures - the act of a product not behaving as expected - the manifestation of a fault (symptoms)

Validation - establishing the correspondence between the software and its specification - "are we building the right product?"

Test care - the collection of inputs, predicted results and execution conditions for a single test

Ad-lib/ad-hoc test care - a test executed without prior planning - especially if the expected behaviors is not known prior to running the test.

Pass/fail criteria - decision rules used to determine whether a product passes or fails a given test

Coincidental correctness - when behavior appears to be what is expected, but it is just a coincidence

Test suite - a collection of test cases necessary to "adequately" test a product

Test plan - a document describing the scope, approach, resources and schedule of intended testing activity - identifies features to be tested, the testing tasks, who will do each task, and any risks requiring contingency planning.

Oracle - a procedure, process or magical phenomenon that can determine if the actual behavior matches the expected behavior

Incident - when a test produces an unexpected outcome, - further effort is necessary to classify the incident as a software error, a design error, a specification error, a testing error, etc.

Bug report - a method of transmitting the occurrence of a discrepancy between actual and expected output to someone who cares for "follow-up" - also known as discrepancy report, defect report, problem report, etc.

Work-around - a procedure by which an error in the product can be "by-passed" and the desired function achieved.

Why Write Programs?

Concept: If you want your computer to do exactly what you want it to do, you must write a program.

A computer does nothing on its own. In fact, a computer is a dumb machine with no intelligence whatsoever. Despite what you might read in science fiction stories, a computer does nothing more than blindly follow instructions supplied by a programmer. Computers cannot think.
Definition: A program is a set of instructions that tells the computer exactly what to do.

When someone buys a computer today, the computer sits on the desk doing nothing until he loads a program into the computer's internal memory and starts running the program. Just as a VCR does not record shows on its own without being programmed to do so, a computer requires detailed instructions found only in programs.
Suppose that you own rental properties and want to use your computer to track your tenant records. Your computer will not help you out in any way until you load and run a rental property program. Where do you find such a program? There are two ways to obtain programs for computers. You can

(1) Buy one and hope that the program does exactly what you want it to do.

(2) Write your own program.

It's much easier and faster to buy a program that you need. Thousands of programs are on the market today. In fact, there are so many programs out there that you might not see the need for writing your own programs.

If you can find a program that does exactly what you want, you are ahead of the game. If you find a program that meets your exact requirements, you should buy that program because purchasing a program is often less expensive and much quicker than writing the same program yourself or hiring programmers to write it for you.

Think about this for a moment, though: If there are so many programs sold today that do virtually everything, why are programming languages such as Visual Basic continuing to break previous sales records each year? The answer is simple: People buy a computer so that the computer will do jobs that they need done. Firms cannot adapt their business to a computer program. They must find programs, or write their own programs, so that the computer processes information according to the business procedures already in place. The only way to ensure that a program exactly fits the needs of a firm is for the firm to develop its own programs.


Business people are not the only ones who need custom-designed programs. No two people manage their finances exactly the same way; no two scientists need computers for exactly the same kinds of computations; and no two graphic artists need the same kinds of computer drawing tools. Although people buy spreadsheets and word processors for their general-purpose computing needs, many people require specialized programs for specific jobs.

The art of programming computers is rewarding not only from a requirements standpoint, but also on a more personal level. Programming computers is fun! Just as a sculptor looks on a finished work of clay, programmers are often proud of the programs that they write. By the time you finish this book, you will have written programs that were not available before you wrote them. When you want your computer to do something specific and you cannot find a program that does the job exactly the way you want, you will be able to design and write the program yourself.
Some Programs are Changeable: There is a third method for getting exactly the program that you need if you want to computerize your company's accounting records. Accounting software firms often sell not only accounting programs but also the source code for those programs. The source code is a listing of the program's instructions. By having access to the source code, you can take what the software company wrote and modify the behavior of the program to suit your own requirements.

By starting with a functional program instead of starting from scratch, you save programming time and money. Sadly, most non-accounting software firms do not supply the source code. Most programs sold today have been compiled. After compiling, the source code is translated into a locked-in executable program. The bottom line is that you cannot easily change the behavior of compiled programs. For most programs, therefore, you have the choice of buying them or writing them yourself from scratch.

Definition: Code is another name for program.
Review: No single program pleases everyone. When a company sells a program, it must be general enough to please most purchasers. Some people need programs to behave in a specific manner in order to fulfill a specific need. They must resort to writing their own programs. Luckily, Visual Basic takes a lot of the pain out of writing programs.

A Brief History of Textual Programming

Concept: Computers cannot understand just any language. You must learn a language that your computer knows before you can write programs for your computer.

Definition: An application is yet another name for program.
Many people use computers all day long for word processing, database storage, and spreadsheet analysis, without realizing what is going on behind the scenes. You must always keep in mind that computers cannot think. Your computer does not know how to be a word processor. If you want your computer to do word processing, you must supply detailed instructions in the form of a program. Only by following the detailed instructions of a word processor program that you load can your computer perform word processing.

It would be nice if writing a program is as easy as telling the computer what you want done. Many people can handle ambiguous instructions, but computers are not smart enough to understand vague requirements. Computers can only follow orders given to them, and you must supply those orders in the form of a program. Therefore, you must supply the programs that you write. Writing programs, especially complex programs, takes time and several procedural steps. Visual Basic speeds the process of creating programs, but even with Visual Basic some programs take time to write and perfect.

Definition: A bug is a program error.

These are the typical steps that most programmers go through when writing programs. First, you have an idea for a program. Next, you use a program-development system, such as Visual Basic, to write the program. Errors, or bugs, often appear in programs because of the details needed for even the simplest of programs. Therefore, you must test the program thoroughly and fix the errors. Fixing errors is called debugging. Once all the errors are out of the program, you have a finished application.

PROGRAMMING

• A computer is an information-processing machine. [Executes given commands. ]
• Uses memory.
• Information = data. There are various types of data e.g. numerical, text, graphics or pictures, sound signals etc.
• A computer program is a sequence or set of instructions in a programming language.
• All data and instructions for a program are stored in the computer's memory in coded form. This coded form is similar to the mores code (-0---0-00-). The coding or translation is now done automatically. I.e. by commercial or computer programming.
• Programs will be written in the programming languages of which there are many. Like Pascal, Cobalt, (used for records), Visual Basic, etc.
• For the purpose of this module, Visual Basic (VB) programming language will be used. Hence the VB Integrated Development Environment (IDE) will do the translation into coded form, which is a software program.

LOGGING INTO VISUAL BASIC
VBS (adds topics), enter Open, enter
When in the form use - Label 1. Caption = "Hello Class of 2000"
To delete an object from the form Select Edit menu.

ERRORS IN PROGRAMMING

There are three common errors
1 Syntax errors: are due to structure or grammar of the language (rules) applied, e.g. more or less spacing, full stops, commas etc.
2 Routine errors: are due to non-existing situations like 1 divided by 0, is impossibility. These are errors where the program has instructed the computer to perform an impossible operation e.g. as shown above.
3 Logical errors: are those in the meaning of the program.
To save, always SAVE FORM AS, followed by SAVE PROJECT AS.

The Cost of Bugs

Programming, and testing, to its use by the public, there's the potential for bugs to be found. The Figure below shows how the cost of fixing these grows over time.


Cost


Time When Bug Is Found ; The cost to fix bugs increased dramatically over time.

The cost are logarithmic - that is, they increase tenfold as time increases. A bug found and fixed during the early stages when the specification is being written might cost next to nothing or 10 pence in our example. The same bug, if not found until the software is coded and tested, might cost £1 to £10. If a customer finds it, the cost could easily top £100.

WHY DOES SOFTWARE HAVE BUGS?

Miscommunication or no communication - as to specifics of what an application should or shouldn't do (the application's requirements).

Software complexity - the complexity of current software applications can be difficult to comprehend for anyone without experience in modern-day software development. Windows-type interfaces, client-server and distributed applications, data communications, enormous relational databases, and sheer size of applications have all contributed to the exponential growth in software/system complexity. And the use of object-oriented techniques can complicate instead of simplify a project unless it is well engineered.

Programming errors - programmers, like anyone else, can make mistakes.

Changing requirements - the customer may not understand the effects of changes, or may understand and request them anyway - redesign, rescheduling of engineers, effects on other projects, work already completed that may have to be redone or thrown out, hardware requirements that may be affected, etc. If there are many minor changes or any major changes, known and unknown dependencies among parts of the project are likely to interact and cause problems, and the complexity of keeping track of changes may result in errors. Enthusiasm of engineering staff may be affected. In some fast-changing business environments, continuously modified requirements may be a fact of life. In this case, management must understand the resulting risks, and QA and test engineers must adapt and plan for continuous extensive testing to keep the inevitable bugs from running out of control

Time pressures - scheduling of software projects is difficult at best, often requiring a lot of guesswork. When deadlines loom and the crunch comes, mistakes will be made.

Egos - people prefer to say things like: 'no problem', 'piece of cake', 'I can whip that out in a few hours' 'it should be easy to update that old code'
Instead of: 'that adds a lot of complexity and we could end up making a lot of mistakes' or ‘we have no idea if we can do that; we'll wing it', 'I can't estimate how long it will take, until I take a close look at it', 'we can't figure out what that old spaghetti code did in the first place'

If there are too many unrealistic 'no problems', the result is bugs.
Poorly documented code - it's tough to maintain and modify code that is badly written or poorly documented; the result is bugs. In many organizations management provides no incentive for programmers to document their code or write clear, understandable code. In fact, it's usually the opposite: they get points mostly for quickly turning out code, and there's job security if nobody else can understand it ('if it was hard to write, it should be hard to read').
Software development tools - visual tools, class libraries, compilers, scripting tools, etc. often introduce their own bugs or are poorly documented, resulting in added bugs.

No comments:

Post a Comment