Construction and manipulation of software solutions Building, checking, modifying and developing software solutions covers understanding a range of programming languages, choosing an appropriate language to solve the problem, the syntax of the chosen language and the approach taken by that language. It also requires choosing an appropriate development approach, for example top-down approach. Software developers then have a responsibility to ensure that their program continues to work, which may require modifying the program. We will be looking at the following areas:
Building software solutions
Checking software solutions
Modifying software solutions
Developing software solutions
Building software solutions Definition “Building software solutions covers understanding a range of programming languages, choosing an appropriate language to solve a problem, the syntax of the chosen language and the approach taken by that language. It involves the development of the user interface and the documentation of each step in the building phase." (Wilson. C, (2001) Software Design and Development: The Preliminary Course.)
Meta languages A language used to describe the rules of programming languages.
Low-level Languages are processor dependent: that is, they will only work on a particular type of processor. Each instruction written in these languages is a single step in executing the program. The instruction is clear and precise,
High-level Languages are processor independent: that is, they will work on many different types of processors. They use translators to change the source code into object code or machine language.
Ambiguous Instruction is an instruction that can interpreted in many different ways or which lacks a clear message.
Types of coding errors Programming code doesn't have errors, it has bugs. Finding and correcting errors is called debugging. Many mistakes should be detected and corrected during the development of algorithms. The major types of errors are:
Syntax errors - are errors that result if a code statement does not conform to the rules of the language.
Run-time or execution errors - are problems which appear when a translated program is executed. They occur when a statement attempts an operation that is impossible for the translator to carry out. An example would be a division by zero.
Logic errors - are errors that cause incorrect actions to be taken in the program, so that output is not what is expected. A program will still run but produces incorrect results. These are the hardest errors to find and correct.
Debugging tools and techniques Debugging is detective work, that is, finding the problems or errors in the program. Common types of debugging tools or techniques include:
Stubs - are used to check the connection between modules of code. They are small modules that can be used to replace part of a program, particularly sections that haven't been written or that are suspected of containing errors.
Breakpoints - are included in those translators that have inbuilt break execution structures and process which allow the programmer to check one line of code at a time. A breakpoint is a marker in the code that tells the translator to suspend execution.
Flags - are boolean variables and are used to check if a section of code that has been processed.
Debugging Statements - are additional statements in the code that help to tell what part of the code has been executed or to check variable values at a particular point in the program's execution.
Libraries of Code A library of code is a set of routines or modules stored for future use. Common routines used in many programs include:
Data Validation is checking that input data is of the correct type and meets any restrictions set in the program.
Date conversion is a routine that converts the date from what the user inputs into what the computer understands.
Combining code and modules from different sources
A call invokes a routine in a programming language, Calling a routine consists of specifying the routine name and optionally, parameters.
Procedure - is used to locate a subprogram and to invoke the routine. Procedures do not return any values.
Function - are similar to a procedure, but should be designed to return a value of any data type.
Scope - the extent or range of operation of an identifier. When a program, a given identifier may be accessed.
Documentation Documentation is a written description of the programming cycle and specific facts about the program. The program should be documented throughout all stages of the development life cycle. Two types of documentation:
External documentation - documentation that is not included as part of the program code, such as manuals, reports or update on progress.
Internal documentation - comments included in the program code to assist in the development and modification of the program.
Intrinsic documentation - naming conventions given to variables and data structures in code to easily identify its purpose.
Checking software solutions Definition “Checking Software Solutions ensures that the developers of the software ensure that their program works properly under as many different conditions as possible. They particularly have to ensure that the program they develop solves the problem it claims to solve ". (Wilson. C, (2001) Software Design and Development: The Preliminary Course.)
Information To ensure the software (product) works under all conditions possible, the following conditions should be met:
it produces relevant and logical output
it will not fail under most conditions of use, that is, the program will continue to work even if errors are made or unexpected actions are taken by the user.
Test Data is sets of data that test all possible output of a program. Testing using test data is simple in a simple program, but becomes very different when programs are more complex. It should be defined in the defining phase of the software development cycle. There are two types of testing:
Black box testing is where each module is checked for input/output.
White box testing is where each path in each module is checked for correct processing.
Statement-coverage testing can be used to check individual lines of code using tree diagrams. They will show the structure of a statement in any programming language. A phase tree shows the hierarchy of each part of a statement.
Thorough testing should test:
all parts of a program or algorithm
each path execution of the algorithm or program can follow
Test data should include:
all the legal, expected values in the program, such as any critical values and boundary or range values.
illegal and unexpected values such as values outside the variable range set in the program.
illegal and unexpected values such as keyboard errors and deliberate errors made by a user.
Evaluation of Design
Software needs to be evaluated to ensure that it meets the program requirements.
Evaluation is the process of deciding the value of the program overall.
Verifying that a program performs the correctly and produces the correct output is the function of testing the algorithm and program with test data.
Validating the program is the task of making absolutely certain that the program meets the original specifications and does what the user wanted it to do.
Peer checking is a way of evaluating a solution by using the expertise of others with similar talents or skills.
Structured walk through are usually carried out by a team composed of various people with different skill and ability levels.
Evaluation of the Implemented solution Documentation becomes very useful when a solution needs to be checked to see if it meets the original design specifications. The easiest way of doing this is to go back to the definition phase and to list all the design specifications that needed to be met in the program. User feedback involves obtaining information from the user as to the operation of the program. The user's comments and criticisms can be very valuable.
Modifying software solutions Definition “Modifying Software Solutions means fixing problems with existing programs. Modifications are an important consideration when the original program is being developed". (Davis.S, (2001) Software Design and Development: The Preliminary Course.)
Reasons for maintenance coding can be undertaken to:
adapt a program or bring the code up to date
correct problems identified by program users such as poor navigation
expand the original solution in any number of ways by adding modules or procedures to give extra functionality
make changes to data input or structures
improve the original program so that it is easier to maintain
cater for new or different hardware where data input or output methods have been changed
meet new requirements such as changes to government policy
Original design The design of the program can make it easier to maintain. Usually it is easier to modify a program written in a high-level language than one written in a low-level language. A macro is a series of stored commands that can be executed by the user. Macros are used to save time and to lessen typing mistakes when carrying out long or complicated processes in an application.
Hierarchy chart in program design The overall problem is sub-divided into sub-programs and the top sub-program became the modules developed in programming code. Essentially it is a diagrammatic way of displaying the structure and modules within the program in a top-down design approach.
Features in source code that improve its maintainability Documentation is the main feature that increases the maintainability of code. Clear and concise documentation makes the task of understanding a program much simpler. Source code has main forms of documentation:
Internal documentation is comments included in the program code to assist in the development and modification of the program.
Intrinsic documentation is a form of internal documentation that uses meaningful names for the procedures and variables used in a program.
Comments may and should be used to document the function and structure of the code. They are an important part of the internal documentation. Use of meaningful variable names Intrinsic documentation is not used effectively if there is no way of telling the function of the variables or constants from their names. Names given to variables or constants are called identifiers.
Use of variables instead of literal constants Programming languages are able to use both variables and constants.
Variables are names given to the storage of items that may change during the execution of the program.
Constants are names given to those items which will not change during the execution of a program, that is, they will keep a constant (the same) value while the program is being run.
Literal constant are constants given a value at the start of a program.
Developing software solutions Definition “Developing Software Solutions is the creation of the program or algorithm using the specifications created during the software development cycle".
Implementing Projects To implement a project is to put a plan into effect. This involves following the steps of the software development cycle to develop a program by defining the problem, and planning, building, checking and modifying the solution. Documentation of each step and some understanding of the details of the software development cycle and the time needed for each stage of the project will be required.
Project may and can be made up of the following people:
Developers are the people involved in the program development who have many different skills to contribute
Consultants are those contracted to provide advice in the development of the program.
Analysts are those people who plan the project to solve the specific problem.
Programmers are those who write the code for the software
Graphic designers, who create the graphical parts of the programs and documentation
Managers are those who oversee the entire project
Users, who contribute knowledge of project requirements and operations
Maintainers are those who keep the program running efficiently once it has been developed
Software testers who test the software for "program errors"
Publication personnel,who are needed for commercial and customized software.
Download and attempt the Google Doc revision questions on testing.
Create your own unique website with customizable templates.