rights and responsibilities of software · web viewrights and responsibilities of software...

46
Software Notes - Shihab Hamid SOFtWARe nOTEs 2002 2002

Upload: ngodieu

Post on 12-Mar-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Software Notes - Shihab Hamid

SOFtWARe nOTEs20022002

Software Notes - Shihab Hamid

Social and Ethical Issues

RIGHTS AND RESPONSIBILITIES OF SOFTWARE DEVELOPERS

(i) Authorship – refers to the ownership or origin of a piece of work. The developer must: – protect their own interest, as well as – protecting the rights of other authors whose modules

have been incorporated into the final solution. Problem: most programs have a variety of component authors (eg. graphics, language creator) which all have to be acknowledged.

(ii) Reliability – refers to the ability of a software program to perform without failure. Software failure occurs when the software performs in an unpredictable manner. Factors that contribute to reliability:– Hardware: compatibility issues– Operating System: interface between hardware and

software– Other Installed Software: sharing of resources– Run-Time Errors: unexpected errorsImprove reliability by keeping to a well-defined standard process for software development. Problem: signal failure on a plane leads to loss of life.

(iii) Quality – a good quality product will meet the program requirements in an efficient manner. Can be judged through certain criteria:– Reliability: (see above)– Ease of use: the comfort of the user with the software

(raise familiarity)– Consistency of user interface: placement, elements,

typeface– Documentation: complete process and product

documentation (must be written in a manner that encourages the user to read it)

– Adherence to software standards: helps development stage and consistency of final product

Quality assurance is a set of procedures used to certify that a generated product meets specified criteria with respect to quality and reliability.

(iv) Response to Problems – software developers have a responsibility to ensure that any problems users encounter with their products are resolved in a timely, accurate and efficient manner. The programmer must analyse the

Software Notes - Shihab Hamid

problem and anticipate similar problems to manage the solution in the future:– Identify the problem– Analyse the problem– Design and test a solution– Implement the solution (usually via a patch)

(v) Code of Conduct – an official agreement describing ethical and moral obligations of the employee. Agreeing to this enhances the reputation of themselves as well as their profession as a whole. The code usually covers:– Acknowledgment (of contributions from other

developers)– Clearance to use copyright– Privacy of personal details and maintenance of business

secrets

(vi) Viruses – software that deliberately produces some undesirable or unwanted results. Software developers have a responsibility to ensure their products do not contain viruses. Precautions:– Scan all incoming emails– Scan all removable media before use– Scan all software before distribution– Update virus definitions regularly

SOFTWARE PIRACY AND COPYRIGHT

– Software piracy is the criminal act of making or distributing an unauthorised copy of a software package.

– Copyright laws are in place to provide developers with legal methods of pursuing piracy cases. At present time it is difficult for developers to enforce their license agreements.

– Widespread piracy has occurred because: software products are easy to copy, the copy is identical to the original, purchaser’s of software believe that they own the code (when they only own the licence to use it).

(i) Intellectual Property – is a work resulting from a creative process. The owner, usually the creator, can protect their intellectual property rights by using the copyright laws.

(ii) Plagiarism – refers to the process of claiming authorship of an intellectual property owned by another person (can be accused of plagiarism if the secondary product is substantially the same as the original).

Software Notes - Shihab Hamid

(iii) Classification of Software in Terms of Copyright:– Commercial: you purchase the licence to use the

software. [1 backup ok]– Shareware: distributed free of charge but after a trial

period of use the user is expected to make a payment to the author (cuts marketing and distribution costs for small software companies). [no mods]

– Freeware: can distribute freely as long as it is for non-profit [no profit from mods]

– Public Domain: software in the public domain does not carry copyright restrictions [all good]

(iv) Ownership vs Licensing – ownership implies you have the right to do what you want with the software, whereas licensing is a contract that entitles you to use the software. A customer does not usually own the software, rather, a licence to use the software is purchased.

(v) Copyright Laws – copyright protection is provided under the Copyright Act 1968. New technologies (esp. software) have been amended to the act to give exclusive rights to licence others using the copyrighted material. This helps to ensure the software industry in Australia is financially viable. Without the act, Australians with creative skills and temperament would leave the country, forcing us to import what we previously made ourselves. Piracy also causes an increase in the price of legitimate software as the cost of development needs to be spread over a smaller number of purchasers.

(vi) Reverse/Backward Engineering – analysing a product and its parts to understand how it works and to recreate its original design, usually with the purpose of creating a similar product based on this design.

(vii) Decompilation – translating machine-executable code into a higher-level code (asm). This allows the program’s design to be more easily understood.

(viii) License Conditions:– Single user licence: 1 backup, multiple computers but

not used same time.– Site licences: install software on a large computer site– Multi-user licences: specifies exactly how many

computers can access the software at one time.

(ix) Network Use – network licences allow computers throughout a network to use the software.

Software Notes - Shihab Hamid

– Concurrent Use Licences: allow a specific number of people to access program simultaneously.

– Domain Licences: allows any number to use the program at any time.

(x) National Perspective – 40% of all software worldwide is pirated, 32% of software used in Australia is pirated (Business Software Association of Australia [BSAA]).

(xi) Copyright Laws and Software Licence Agreements – copyright protection is granted automatically when an original work is made. Copyright notices should be placed on licence agreements, but it is intrinsic that a software product is under some sort of copyright protection.

THE SOFTWARE MARKET

- Marketing: product (satisfies the needs of the target consumer), place (accessible), promotions (advertising), price (for max profit).

(i) Maintaining Market Position – improve current applications and/or introducing new and innovative products. SWOT (Strengths, Weaknesses, Opportunities, Threats) analysis is carried out to ensure market is viable.

(ii) Effect on the Marketplace – software owners can often be persuaded to buy a new version of an application even though the new version has no real benefits. Also, the sophistication of software can be thought of as driving the need for more powerful computers (although now this is not the case). Follows the Leader/Challenger/Follower structure, with some Nichers (specialists to focus on one area of the software market).

Software Notes - Shihab Hamid

SIGNIFICANT SOCIAL AND ETHICAL ISSUES

- Ergonomics: the study of the relationship between people and their work environment (incl. stuff like placement of hardware/peripherals, user-friendly).

- Inclusivity: recognition that all computer users should have equal access to software (incl. non-threatening, non-racial, non-discriminatory prompts, etc)

(i) National and international legal action resulting from software development – eg. Microsoft vs Apple (GUI), Autodesk vs Dayson (1992AUS, extended the definition of a computer program to include the set of instructions itself).

(ii) Public Issues – Y2K (in Aus, $12 bil was spent), computer viruses (eg. “I Love You” cost A$10 bil to fix), reliance on software (household, banks, ATO, aeroplanes).

Software Notes - Shihab Hamid

Software Development Approaches

APPROACHES USED IN COMMERCIAL SYSTEMS

(i) Structured Approach – following steps to ensure the solution is successfully developed. It is used generally for large projects that are being undertaken by a team of developers. It is very time consuming as each step must be completed before the following step. The software development cycle consists of the following stages:– Defining the Problem: involves understanding the

problem in detail and determining whether a solution is feasible (feasibility study: is the problem worth solving? Financial/Operational/Technical feasibility? What are the time and hardware constraints?). Include IPO charts, data flow diagrams and reports. [sys analyst]

– Planning the Solution: the planning and design of a solution to the problem. Involves choosing the appropriate data structures and program structure, planning the characteristics of the user interface, designing the algorithm and determining an appropriate language to use. Include algorithms, flowcharts, storyboards. [sys analyst]

– Building the Solution: converting the specifications and algorithms developed during the planning stage into code. Top-down/bottom-up are decided. Interface is constructed and the code must be documented. [programmer]

– Checking the Solution: once the software solution has been coded it is necessary to check that it operates correctly. The program is tested at module, program and system levels. Live test data is used to ensure the program will operate correctly in its final environment. Testing also involves ensuring the program meets its initial specifications outlined during the problem definition. [programmer + sys analyst]

– Modifying the Solution: may be necessary for a variety of reasons included errors and the requirement of new features. Changes are often made by programmers that weren’t involved in the initial construction of the program. Includes documentation of changes made. [programmer]

(ii) Prototyping – prototypes are interactive models of the final system. Prototypes are useful as an information gathering tool (concept) or to develop the prototype into

Software Notes - Shihab Hamid

the fully functional product (evolutionary). Useful for applications involving a lot of human interaction, such as multimedia (guides) and Internet applications.– Encourages end user participation– Give user feedback on the model– Improves communication between programmer and

end-user (by providing a working model)– Focus on input and output requirements. Also used

when all of the system requirements aren’t known during requirements definition.

– Develops typical screens– Prototypes can bypass data validation and error

handling until the final solution has been accepted– Prototypes have a short development time

(iii) Rapid Applications Development (RAD) – allows programmers to reuse pre-developed code and components of existing programs to speed up development time. The RAD model lacks the formal stages of the structured approach.– Automated tools are used to aid software development– Reusing of code cuts time/cost as the code doesn’t have

to be created or tested, as it is already pre-exists– Best suited to small-scale projects with small budgets– Requires constant communication between developers

and end-users– Usually implemented using OOP– May create legal problems (reusing other people’s

code)– Less efficient (not hand crafted for a particular job)– Examples include: VB, any 4th generation language.

(iv) End-User Development – involves modifying standard customisable-off-the-shelf (COTS) packages to meet the needs of the end user’s own particular situation.– Viability of end-user development depends on ability of

end user– Lack of formal stages; suited to small, individual

projects– Easily modified by the end-user to his/her individual

needs– Examples include: MS Access, FileMaker Pro, etc.

(v) Combination – certain aspects of the problem may require different approaches to form a solution.

METHODS OF IMPLEMENTATION

Software Notes - Shihab Hamid

(i) Direct Cut-Over – immediate implementation of the new system without taking intermediate steps. Most suited to small-scale implementations where large amounts of data do not need to be transferred from an old system to a new system.– The quickest method of implementation– The riskiest as well: all data may be lost– If the old system has failed this method must be used– Data is not duplicated/processed twice– Difficult to provide training to staff is implementation is

sudden

(ii) Parallel – implementing and operating the new system and the old system simultaneously for a period.– Safest method of implementation– Duplicate data occurs and needs to be maintained

(cost/time)

(iii) Phased – gradual and modular replacement of the current system with the new. Each individual module is implemented sequentially over a period of time.– Best suited for large projects where different

subsystems operate independently for most of their operation

– Allows training to be carried out before the entire system is implemented

– Gradual phasing may confuse users– Many businesses combine phased and parallel (for

ultra-security)

(iv) Pilot – conversion that involves a small scale implementation of the new system. This usually involves installing the entire system on a small site before the whole organisation is changed over.– Minimal disruption if there are problems with the new

system– Employees that are pilots can be used to train other

staff– Problems not identified during the pilot testing may

become apparent and detrimental when the entire system is implemented

CURRENT TRENDS IN SOFTWARE DEVELOPMENT

(i) Outsourcing – allows business to have quality software developed by contracting experts without the expense of maintaining a full IT department. Problems: increasing dependence on 3rd party reduces company’s uniqueness.

Software Notes - Shihab Hamid

(ii) Popular Approaches – stepwise refinement (top-down/bottom-up), data-oriented approach, OOP.

(iii) Popular Languages – fourth generation mainly in RAD (used in IT industry), examples: VB, C++, Fortran (math), COBOL (business), Java (portability).

(iv) Employment Trends – IT boomed the greatest in 1995-2000. Currently demand for IT professionals is receding. Greatest number of jobs advertised is for programmers with a knowledge of OOP like Java, C++ and VB.

(v) Networked Software – involves a client/server relationship. This encapsulates four parts: interface, application software, database management software and network software.

(vi) Customised off-the-shelf packages (COTS) – Software that can be purchased as a standard package from a software retailer (End-User Dev).

CASE TOOLS

- Computer Aided Software Engineering tools are software systems which enable software developers to automate many aspects of the process of software development.

(i) Software Versions – versioning allows for software development teams to track changes as they are made to a system. Old versions can be restored if necessary. CASE tools automate the versioning process (Software Configuration Management [SCM]). Eg. PVCS.

(ii) Data Dictionary – is used to identify and fully define entities, entity characteristics and entity relationships. CASE tools automatically keep track of data elements in a tabular format, eg. SQL, MS Access, VB Jet Databases.

(iii) Test Data – CASE tools can be used to generate test data. (see Testing)

(iv) Documentation – Case tools automate and assist in the production of documentation by extracting relevant information from the solution.

Defining and Understanding the Problem

Software Notes - Shihab Hamid

DEFINING THE PROBLEM

(i) Identifying the Problem – defining the problem clearly is essential to ensure the final solution meets the needs of the user.– Needs: clear statement of the requirements definition– Objectives: short and long term aims, clarify what they

want– Boundaries: the boundary is the limit to a system

[constraints]

(ii) Feasibility Study – to determine if development should go ahead.– Is it worth solving?– Constraints: budgetary, operational, technical,

scheduling– Possible Alternatives (non-CBS alternative)– Social and Ethical Considerations: changing nature of

work, effects on level of employment, effects on the public, legal issues (privacy).

DESIGN SPECIFICATIONS

(i) The Developers Perspective – these specifications will create a standard framework under which the team of developers will work. Developers will need to consider the data types, algorithms, variables, software design approach, modelling the system, documentation.

(ii) Data Types – determines the manner in which data is stored and manipulated by the computer program.

Simple Data Types Single unit of dataCharacter ASCIIInteger Whole numberReal Decimals/Fractions/ExponentsBoolean True or FalseStructured Data Types

Combination of simple data

Sting Words, usually up to 265 charsArray Homogenous data structure

(indexed)Record Heterogenous data (fields)File Externa storage, heterogenous,

no orderArray of Records Heterogenous data (indexed)

Software Notes - Shihab Hamid

Abstract Data Types OOP: methods incorporated in variable

Enumerated Data Types

User defined data type

(iii) Algorithms – series of unambiguous instructions that will result in the solution to a specific problem in a finite time. Control structures:– Sequence– Selection (binary [IF..THEN..ELSE], multiway

[CASEWHERE])– Repetition/Iteration (pre-test [WHILE], post-test

[REPEAT])

(iv) Variables – a pointer to an area in memory that is used by a program to store data. Declaration involves defining the variable name and its data type.

(v) User’s Perspective – specifications developed from the user’s perspective should include any design specifications that influence the experience of the end-user. Consideration is given to screen design, appropriate messages, icons, relevant data formats for display, ergonomic issues, relevance to the user’s environment and computer configuration, social and ethical issues.

MODELLING

(i) Representing a System Using Diagrams – system modelling tools allow the system designer to communicate and record the system so that users and other developers can understand the system. All system modules have – function (purpose/final result)– logic (procedures)– interfaces (links between modules to transfer data, ie.

parameters).

(ii) IPO Charts – shows the inputs, processing and outputs that make a system. HIPO charts have IPO and a hierarchy chart illustrating the modules. No relationships between I, P and O are shown.

(iii) Storyboards – give a general overview of the program, emphasises the user interface rather than the functions of the system. It is used to reflect the navigation between screens (used in prototyping and multimedia projects).– Linear: screen1 screen2 screen3– Hierarchical: subsystems arranged in a tree– Network: screens arranged in a web, can be accessed

from various ways

Software Notes - Shihab Hamid

– Hybrid: mixture of any of the above

(iv) Context Diagrams – used to represent entire information systems. Same as a DFD without data labels on the dataflow arrows and no data stores. [process, dataflow, external entity]

(v) Dataflow Diagrams (DFD) – represent the direction of data flow between external entities, processes and data stores. Dataflow lines have labels indicating the data that they carry.

(vi) System Flowcharts – diagrammatic way of representing both the flow of data and logic through an information system.

(vii) Screen Designs – the screen is the first point of contact between a user and a program. By constructing screens the client can communicate what is required of the program in terms of input and output.

(viii) Use of a Limited Prototype – prototypes are interactive models of the final system. A prototype is a hands-on model of the system that concentrates on the design of input and output screens. Thus, valuable information is gathered from the user.

(ix) Decision Tables/Data Dictionaries

(x) Structure Diagrams – used to show the precise relationship between the various modules of a system.

COMMUNICATION ISSUES

(i) Empowering the User – people feel comfortable when you when they have some feel of control of the situation and have a sense of ownership of the product. Thus, users are more likely to contribute suggestions to the system.

(ii) Acknowledge the User’s Perspective – user is interested in applying the program, not the actual functions of the program.

(iii) Enabling and Accepting Feedback – the cost to fix an error in a program increases exponentially as the system is developed (better to eliminate errors as soon as they appear)– Interviews: formal and informal– Questionnaires/Surveys: reflects a majority opinion– Meetings: discuss and collaborate

Software Notes - Shihab Hamid

– Observation: view user and see how they use the system

Software Notes - Shihab Hamid

Planning and Design of Software Solutions

STANDARD ALGORITHMS FOR SEARCHING AND SORTING

- Computers require are clear and unambiguous. An algorithm is a series of stets that, if followed in order, will solve a problem in a finite amount of time.

(i) Finding Max and Min Values – technique: set initial max and min variables to data in element 1 of the array. Search through each element, replacing min and max where appropriate. Don’t forget to increment index.

(ii) Processing Strings – use loops and indices a lot to find the length of, concatenate, extract, insert and delete strings.

(iii) File Processing – a file is a collection of data stored on a secondary storage device. Files must either be opened or created to allow access (for read/write). Sequential files require the file to be read line by line, whereas random/direct files can be read at any point. It is beneficial to store the file in a data structure which can be more easily manipulated by the program.

(iv) Sentinel Value – files are often terminated by this special character (EOF).

(v) Linear Search – used to search through a set of unsorted data sequentially. Technique: all elements compared to target value, use a flag to indicate if it is found, when it is found exit the loop and report data. Don’t forget to increment index.

(vi) Binary Search – used to search through data that has been sorted (uses random access). Technique: split the array into two (integer divide); target either lies at the middle point, to the left of it, or to the right of it; loop until target is at middle or lower > upper.

(vii) Bubble Sort – data elements are compared in pairs and the larger pair bubbles to the end of the array. After each pass, the largest data element is sorted. Technique: end is decremented after each pass, compare two adjacent

Software Notes - Shihab Hamid

values and swap values if they are out of order. [2 loops+swap]

(viii) Insertion Sort – during each pass of an insertion sort, the last element from the unsorted part is inserted into the appropriate place of the sorted part of the array. Technique: shuffling the array until the spot has been found (?).

(ix) Selection Sort – during each pass of a selection sort, a linear search is carried out in the unsorted part of the array to determine the largest object that has not been sorted. Technique: linear search to find max value and swap it’s index with the last unsorted element.

Software Notes - Shihab Hamid

CUSTOM-DESIGNED LOGIC USED IN SOFTWARE SOLUTIONS

(i) Requirements– Specifying input and output– Defining the rules and processes– Determining the data structures to be used– Designing appropriate test data

(ii) Identification of IPO – the software developer must fully describe the data and its format.

(iii) Representation as an Algorithm – Algorithms can be transformed to code easily as the procedure of processing is specified in the algorithm itself.

(iv) Definition of Required Data Structures – data structures are the set of rules for storing and manipulating data. Data structures are usually defined in a data dictionary (Identifier, Data Type, Data Length, Description).

(v) Use of Data Structures – the better the data structure, the easier and more efficient the algorithm will be (eg. Array of Integers opposed to individual integers alone). Multidimensional arrays are useful for storing grid data or 3D data. Arrays of records allow member data to be entered in fields. Nested loops allow the manipulation of data in arrays in an efficient manner.

(vi) Use of Random Numbers – often used in programs to allow access to unpredictable data (eg. games where dice needs to be rolled).

(vii) Thorough Testing – testing isn’t a completely separate activity, it is an integral part of every phase. Algorithms should be tested thoroughly by performing desk checks to ensure the expected outputs are achieved.

STANDARD MODULES (LIBRARY ROUTINES) USED IN SOFTWARE SOLUTIONS

(i) Standard Module – structured programming results in programs that are modular. Each module carries out a specific task. Libraries of code (standard modules) allow the programmer to solve a problem rather than have to understand the low level instructions that are carried out when performing a command.

Software Notes - Shihab Hamid

(ii) Identification of Appropriate Modules – programmers should only use the modules or libraries that are necessary to perform the task required. It would be a waste of resources to include redundant libraries not accessed by the program. These packages contain precompiled commands that allow a range of operations to be carried out. It is essential that all custom made standard modules are thoroughly testes as they will be regularly reused.

(iii) Scope of Variables – local variables are defined and accessed within a subprogram, whereas global variables are defined in the mainline of code and accessed via all modules.

(iv) Parameters (Arguments) – data items which can be passed from one module to another, where the values can be used.

(v) Testing Using Drivers – a driver is a special form of stub which is used to call subprograms. The driver is used to pass on parameters to test the workings of the subprogram. It is mainly used in the bottom-up approach.

(vi) Thorough Documentation – should specify the inputs (parameters), processes, and output for every module in the program. Allows programmers to easily reuse modules and make modifications.

CUSTOMISATION OF EXISTING SOFTWARE

Customising existing software solutions in faster development time and thus a lower development cost. This is at the expense of efficiency as customising existing modules may not allow for changes in hardware/software settings – it may become necessary to reengineer the software solution to ensure it operates efficiently.

DOCUMENTATION OF THE OVERALL SOFTWARE SOLUTION

- Documentation is developed to communicate and record the system so that users and other developers can understand it.

- The following tools are used to represent a complex software solution:

(i) Algorithm Descriptions(ii) System Flowcharts(iii) Structure Diagrams(iv) Dataflow Diagrams(v) Data Dictionaries

Software Notes - Shihab Hamid

SELECTION OF LANGUAGE TO BE USED

(i) Event Driven Programming- does not have a linear or sequential structure.- operation of program is triggered by users actions

(events), eg. mouse click driven by user.

- during program execution the computer’s OS continually polls the

hardware to generate a stream of events. - used widely in visual languages where a GUI provides

an interface in which the user can affect processing.

(ii) Sequential Programming- each program has a definite beginning and end- programmer specifies order of processes (sequence)

(iii) Relevant Language Features – programmer must carefully select an appropriate programming language, factored by the problem itself.

(iv) Hardware Ramifications – eg. logic programs require multiple processors

(v) GUI – almost obligatory as it greatly enhances user-friendliness of programs.

Implementation of Software Solutions

INTERFACE DESIGN

(i) Design of Individual Screen– Consistency of design– Ergonomic factors– Aesthetic consideration– Appropriate messages to the user– Legibility

(ii) Screen Design Principles– Large amounts of text should be broken up by the use

of graphics, headings or borders. A program should be able to communicate with the user in a concise, non-threatening manner. Language should be clear, unambiguous and of a level which is appropriate to the user.

Software Notes - Shihab Hamid

– Graphics: the most noticeable features on the screen; avoid over using and avoid a screen containing text only.

– Legibility: refers to the ease with which a screen can be read (contrast).

– Position of Text: an aesthetically pleasing screen only contains 15-20% text; break up text with graphics and borders.

– Size and Style of Font: Serif is easier on the eyes, San Serif should be used in titles. Mix upper and lower case letters. Descending levels of importance for descending size.

– Colour of Text and Background: legible; colour has emotional connotations; colour should always be used for a purpose (eg. web page hyperlinks); do not discriminate the colour-blind.

– Borders: define areas on the screen and group similar objects.

(iii) Current Popular Approaches– A command line interface involves entering the

commands on the keyboard, which are executed by the computer.

– GUI encourages the development of event driven programming and enhances the user-friendliness of the program.

(iv) Screen Elements – (think VB objects)– Menus: easy to use and allow for definite,

unambiguous input from the user (eg. pull-down menus, pop-up menus).

– Windows: are of the screen enclosed by the a border and can be resized and moved. Used to group different screens. [WIMP]

– Icons: symbolic representation of an option or action.– Navigational Elements: include scroll bars, hypertext,

anchors, image maps (basically all web page navigation stuff).

– Radio Buttons: choice between several mutually exclusive options.

– Check Boxes: allows user to toggle a number of options which are not mutually exclusive.

– Dialogue Boxes: used to communicate information (to and from user).

Software Notes - Shihab Hamid

(v) Help Screens – use non-threatening and unambiguous messages.– Context Sensitive Help: help relevant to user’s

actions. [tips]– Procedural Help: concise instructions, step-by-step

guide.– Conceptual Help: explains “what” and “why” rather

than “how”.– Tours: give new users an overview of the product.– Tutorials: how to complete specific tasks, step-by-step

guide.– Wizards: automate complex tasks [office assistant]

(vi) Audience Identification– Program should be able to communicate with the user

in a concise, non-threatening manner.– Language should be clear, unambiguous and at a level

appropriate to the user.– Consideration needs to be given to visually and hearing

impaired (don’t use colours/sounds to the point where they become essential).

(vii) Consistency in Approach– Placement of repeated items: exit buttons, etc.– User interface: allow the use of mouse and keyboard.– Fonts: same fonts should be maintained throughout

program.

LANGUAGE SYNTAX

(i) Syntax – a programming language uses a precise set of rules that specify the form of what can be written in the program – independent of meaning.

(ii) Semantics – refer to the meaning of the individual statements

(iii) Reserved Words – inbuilt functions that cannot be used as identifiers.

(iv) Language– Operators: mathematical (+ - / * ^ mod =); relational

(> < =) ; logical (AND OR NOT); string (LEFT RIGHT MID &).

– Identifiers: labels or names given to elements in the program.

– Control Structures: sequence, selection, repetition.– Separators: spaces, brackets, etc.– Delimiters: colons, carriage returns, etc.

Software Notes - Shihab Hamid

(v) Representation of Syntax – using metalanguage– BNF (Backus-Naur Form): syntax description which

includes or “|” and non-terminal symbols “<…>”. Repetition is done via recursion, eg. word::=<letter><word>|<letter>, letter::=a|b|c.

– EBNF (Extended BNF): can use grouping “( )” and optional statements “[ ]”. Also allows for repetition “{ }” repeated zero or more times. Eg. word = <letter>{<letter>}, letter = a|b|c.

– Railroad Diagrams (Syntax Structure Diagrams): name is on beginning of railroad, terminals are in circles/ovals, predefined syntax is represented by rectangular boxes. Repetition is illustrated via loops.

– Commands: arrays [dim array(1 to 10) as integer]; array of records [type…end type]; files [open “c:\fille” for input as #1 or open “c:\fille” for random as #1 len = record]; random number generators (sys time).

THE ROLE OF THE CPU IN THE OPERATION OF SOFTWARE

(i) Machine Language – the only language that the computer (Von Neumann model) can understand without translation. The CPU is made up of the ALU and control unit:

(ii) Instruction Format – OP Code [4bits] | memory address [12bits]. Each memory location in RAM has an address and storage location.

(iii) Register – temporary storage location that is able to hold one instruction.

(iv) Accumulator – one of the registers in the CPU, it stores data that is about to be used in a computation or the results of the computation.

(v) Fetch-Execute Cycle– Fetch: reads an instruction from RAM.– Decode: control unit decodes instruction to determine

what action should be taken. The operation code is decoded according to the set of instructions built in the computer’s ROM.

– Execute: this action is then carried out by the ALU.– Store: place result in RAM.

Software Notes - Shihab Hamid

(vi) Program Counter – the PC is a register that is part of the computer’s CPU. The program counter stores the address of the next instruction to be executed. It is automatically incremented after completing an instruction. Instructions are executed sequentially unless part of the instruction is to change the value of the PC (eg. for loops [jmp]).

(vii) Linking – liking allows for a machine code program to be combined with another machine code program. Many large programs are compiled at a modular level and a linker is used to join these compiled modules together. This allows only the modules that are used to be loaded, thus saving time.

(viii) DLL (Dynamic-Link-Library) – a collection of programs in machine code which can be accessed by other programs to perform specific tasks, eg. device drivers (printers).

Software Notes - Shihab Hamid

TRANSLATION

(i) Translation – is the process of converting high level source code into machine executable object code, so that it can be processed by the computer

(ii) Interpretation – each line or statement of source code is translated into machine code and is immediately executed.– Errors will halt translation and allows developers to fix

the error– Run time and syntax errors can thus be detected and

fixed efficiently.– Interactive programming, used by developers– Not generally used by end-users as it increases the cost

and reduces the efficiency overall package as it needs to be interpreted all the time.

(iii) Compilation – entire source code is translated into executable code.– Independent of a translator once complied.– Faster execution.– Security (cannot be modified without decompilation).– Allows for optimisation (removes redundant code).– Processor dependant object code is produced– Modifications to source code means entire program

needs to be recompiled.– Compiling stops when an error is reached

(iv) Incremental Compilation – reduces translation time by only recompiling the parts of code that have changed since the last compile took place.

(v) Translation Process in Detail– Lexical Analysis: uses delimiters to break down the

code into single commands, redundant characters (spaces) and remarks are removed, compared each group of characters to a dictionary of the lexemes and assigns tokens to them. Errors: use of undeclared identifiers, incorrect naming of identifiers, incorrect constant syntax.

– Syntactical Analysis: an examination of whether the identified elements of a statement are combined together in a way that is legal, according to the syntax of the language. This is known as parsing. Errors: incorrect arrangement of the tokens (syntax error).

– Type Checking: tests the validity and integrity of data types. Errors: type mismatch. Once this is done, a loader is used to manage the allocation of memory addresses for the variables.

Software Notes - Shihab Hamid

– Optimising (optional): removes redundant sections of code and speeds up the execution of programs by finetuning the programming statements.

– Production of Object Code: all the characters in strings are converted into binary using ASCII; reserved words are replaced by calls to machine language functions or run-time libraries; these are then linked by a linker that calls up compiled modules or other programs, integrating them with existing code to form a complete program.

Software Notes - Shihab Hamid

PROGRAM DEVELOPMENT TECHNIQUES IN SOFTWARE

(i) Stepwise Refinement – is the process of dividing a problem into smaller units. The solution of the overall problem is the sum of the solutions to the smaller, more manageable units.

(ii) Two different methodologies are used: top-down and bottom-up. The use of modules greatly simplifies the programming process. Modules are designed to perform one logical task – this greatly simplifies the error detection and correction as only the faulty module needs to be tested and fixed. It also allows for incremental testing of the individual modules. An elegant solution is always desirable as it efficiently completes the task.

(iii) Types of Errors:– Syntax Errors: detected by the compiler when it is

unable to match items in the source code to the syntactic entities in the language. They are simply illegal statements. Examples include and undefined or a parse error [;].

– Logic Errors: usually caused by an error in the program. These are caused by incorrect algorithm design or incorrect coding of the algorithm. Errors include: manipulating the wrong data, leaving out a part of the algorithm, reusing variables which still require old values, using the same name for a global and local variable, duplication of variable names, performing statements in the wrong order, loop errors in counting variable. Detected through thorough desk checking.

– Run Time Errors: use of live data to test the actual program may reveal errors not evident in compilation. Examples: arithmetic over flow, division by zero, accessing inappropriate memory locations (arrays). May also result from conflicts with hardware, OS, other installed software.

(iv) Techniques for Detecting Errors– Stubs: used in place of a module that is thought to be

causing the problem. Resulting from the top-down methodology.

– Drivers: used to call modules, to test the operation of the module by passing a variety of parameters. Bottom-up methodology.

– Flags: check if sections of the code have been executed. Used to determine the flow of control in the module.

Software Notes - Shihab Hamid

– Debugging Output Statements: strategically display output.

– Peer Checking: colleagues can see the program from a fresh perspective.

– Desk Checking: use when workings of code are not fully understood.

– Use of Expected Output: Compare expected output to program output.

(v) Tools for Detecting Errors– Breakpoints: used to temporarily halt the execution of

the code so that the contents of the variables can be examined.

– Resetting Variable Contents: determine which values are causing the error to occur.

– Program Traces: view the order of execution of the statements.

– Single Line Stepping: halting after each line is processed.

– Watch Expressions: the data of variables can be monitored.

Software Notes - Shihab Hamid

DOCUMENTATION

- Documentation is an intrinsic part of every stage in the software development cycle. It is a point of reference for software developers and users. Documentation needs to be continually revised to reflect the programs current progress.

(i) User Documentation – users are the final operators of the product and documentation needs to be created that encourage the users to refer to it.– Installation Guides: provides the user with sufficient

details on how to install the program (on different OS’s), and lists the minimum system requirements of the software.

– User Manual: presents topics in a structured way that can be easily followed. Should provide simple explanations, clear and easy to follow format, use diagrams and screen dumps, explain main or new features of the program and how to use them.

– Reference Manual: details all commands and functions in the program, usually in alphabetical order, so that the users can lookup specifics.

– Troubleshooting Guide: aims to provide answers to common problems, usually includes contact details for unsolved problems.

– Online Documentation: help files, wizards, tutorials, balloon help, templates, demonstrations.

(ii) Technical Documentation – describes the structure and engineering behind a product. Used for maintaining, upgrading, etc.– Process Diary: records the systematic series of actions

that have occurred during the development of a project. Process Diaries or Logs are used during software development and maintaining a process diary chronologically records the processes undertaken to develop the final product. Used: to determine relative costs of the stage, reflective devices to avoid mistakes in the future.

– Source Code Documentation: intrinsic documentation (use of descriptive variable names, indentation, bold/colours), comments.

– Diagrams/Tables: flowcharts, IPO, data dictionaries and all that.

HARDWARE ENVIRONMENT TO IMPLEMENT THE SOFTWARE SOLUTION

Software Notes - Shihab Hamid

Include details of minimum system requirements and optimal hardware configuration. Allow for the possibility of additional hardware (eg. 1GB or RAM capable, barcode scanners of different types). Also include common hardware drivers to the solution and allow for the use of other manufacturer’s drivers to be compatible as far as possible.

EMERGING TECHNOLOGIES

– Hardware: nanotechnology (molecular), quantum computing (subatomic), embedded processors (eg. in a light globe), smart appliances (eg. smart cards, smart fridges), holographic storage (transfer rate of 1GB/s).

– Software: WAP software, Java (multiplatform), DIVx (video compression).

– Effects: unwanted advertising, loss of reality and individuality, increasing dependence on technology.

Software Notes - Shihab Hamid

Testing and Evaluation

Testing is carried out to find all errors in a program that is being developed. Testing should be undertaken throughout all stages of the program development cycle. Software developers must continually ensure that the original specifications are being met in the software being developed.

Test data – input that is used to ensure the correctness of an algorithm or program. A set of test data must test:

- all parts of a program- each path of execution (minimum)- boundary conditions

Levels of testing:- Unit/Module – modules can be tested individually via

drivers.- Program/Integration – completely test a program

either by testing each path of execution or with live data. Interface between modules are tested. The user interface is also tested.

- System – hardware (different configs), software (OS and COTS), data (live data), personnel and procedures (interfaces, usability, beta testing).

Live Test Data – allows environmental problems to be identified and removed:

Large File Sizes – during development small files are used, but in practice large databases are used. Highlights problems with data access (eg. array must be big enough to cater for input, lack of speed in processing).

Mix of Transaction Types – usually, alpha testing tests the program in a logical/systematic manner whereas in practice the processing is usually in a sporadic/random manner, (eg. banking systems, cash flow is sporadic).

Response Times – time taken for a process to complete. Program tested under normal and extreme conditions with minimum system requirements. 1s delays are acceptable, 0.1s is ideal (eg. website).

Volume Data – test the system under heavy loads, over time a program may be required to deal with an increased amount of data and simultaneous manipulation of the data (eg. business growth).

Interfaces Between Modules – ensure data and control is correctly transferred between modules.

Software Notes - Shihab Hamid

Checks the parameters that are passed or accepted. Also tests conflicts with local and global variables.

Comparison with Program Test Data – by comparing the data set outputs, differences will highlight errors in the system, opposed to errors in the program.

Benchmark – a point of reference from which quality or excellence is measured. Allows end-users to make informed decisions when purchasing software.

Quality Assurance – the quality of a software product is measured against how well the product meets/exceeds the user’s expectations (reliability, efficiency, etc)

Documentation – test requirements (objectives), test plan (time line), test data and expected results (table), test results and recommendations.

Communication – with clients (to see if they approve), with software developers (if testers have been outsourced).

Case Tools – WinRunner (functional testing, automates tasks), LoadRunner (volume testing), DataTech (test data generation), UsableNet (response times).

Testing Methods:- Black Box Testing: (aka functional testing) The inputs and

expected outputs are known but the processes occurring are not known.

- White Box Testing: (aka structural or open box testing) A software testing technique whereby explicit knowledge of the internal workings of the item being tested is used.

- Alpha Testing: Testing of the final solution by personnel within the software development company prior to the products’ release.

- Beta Testing: Testing of the final solution by a limited number of users outside the software development company using real world data and conditions.

Software Notes - Shihab Hamid

Maintenance

Maintenance is an ongoing process of correction and refinement (about 60% of work on a software solution is maintenance). The fulfilling of the requirements of end-users is the central aim of all software products.

Reasons for change:- changing user requirements (more functions)- upgrading the user interface (graphics is websites)- changes in the data to be processed (franc and euro

conversion)- introduction of new hardware or software (OS

upgrades, maximise potential of hardware)- changing organisational focus (girls school to co-ed

school)- changes in government requirements (GST)- poorly implemented code (wider hardware outlook)

Location of sections to be altered:- models of the system are used to identify which

sections of the code need to be modified.- structure diagrams and dataflow diagrams will help,

once a module is identified the programmer can analyse the algorithm and actual source code.

Determining the changes to be made:- the problem needs to be solved in structured manner so

that the solution does not add to the problem (eg. changing data structures).

- analysis of the original documentation should alert programmers to the possible consequences of changes.

Implementing and testing the solutions:- the program needs to be tested as a whole as the

changes may affect other modules.- regression testing is the process of retesting a program

to ensure the changes have not affected a previously working part of the program.

Documentation:- needs to be updated to reflect the changes in the

software solution.- intrinsic documentation and comments should be used

to document changes in the source code, macros and scripts.

Software Notes - Shihab Hamid

- updates in documentation are usually not hardcopies as it is an expensive task to print and distribute the updates. Updates are generally supplied as softcopies (Portable Document File) that can be viewed and printed.

- many software products contain online help files that provide context sensitive help and troubleshooting guides.

CASE Tools:- helps monitor changes made to software by versioning.- system configuration management (SCM) tools are used

to record and archive the modifications is software from version to version, in the form of diagrammatic representations.

Software Notes - Shihab Hamid

Evolution of Programming Languages

A programming language is a set of rules and procedures that is made up of a defined set of programming commands, expressed according to syntax rules.

Gen

Examples Features

1st - Machine/Binary Code

- no translation required – efficient- hard to code – programmer requires intimate details of hardware

2nd - Turbo Assembler- MS Assembler

- same as above, little translation- mnemonics – easier to understand and less transcription errors- libraries

3rd - C- Pascal- BASIC

- a single line of code can refer to many processor actions- English-like words- independent of processor- use of variables and control structures

4th - SQL- Excel

- more automated- faster code generation- less efficient

5th - START - natural languages – knowledge base- exchange of dialogue – bad grammar and spelling is handled.

Repetitive tasks form routines – reusability, efficiency, less debugging.

Programming:

(i) Sequential - each program has a definite beginning and end

- programmer specifies order of processes (sequence)- heavily relies on variables/assignment statements- generally up to 3rd generation

(ii)Event-Driven - does not have a linear or sequential structure

Software Notes - Shihab Hamid

- operation of program is triggered by users actions (events), eg. mouse click.- used widely in visual languages where a GUI provides an interface in which the user can affect processing

Languages:

(i) Procedural – controlled by the programmer; everything from input, processing and output is specified exactly.

(ii)Non-Procedural – required form of result is known but the processes involved are not. Result is inferred from logic.

Software Notes - Shihab Hamid

Emerging Technologies

All widely used processors still process data sequentially. Parallel computing – multiple processors can share

processing tasks (multitasking). Uses in AI and knowledge bases involving expert shells.

Quantum computing – atomic particles such as electrons and photons to represent 0’s and 1’s.

Molecular computing – molecular memories could have a million times the storage density of today’s computers. DNA can be customised to perform specific tasks.

Neural Networks – getting computers to recognise patterns (AI). Uses a large number of processors.

Visual Programming Languages – OOP and GUI allow greater programmer productivity. Visual programming languages provide simple ways to create interactive programs.

Development of Different Paradigms:(i) A need for greater productivity(ii) Recognition of repetitive standard programming tasks(iii) A desire to solve different types of problems(iv) The recognition of different building blocks(v) Emerging Technologies

Paradigm – a philosophical or theoretical framework. A paradigm shift is the change in a particular way of thinking.

Software Notes - Shihab Hamid

Imperative Paradigm

Based on Von Neumann computer. Fetch-execute cycle processes data (single processor). Uses variables and control structures of sequence, selection

and repetition. Complex syntax. Logical testing of subprograms. Runs efficiently as it is based on the Von Neumann model but

may be very slow to develop. Learning Curve – easy to learn as it is very structured. C - general, BASIC - beginner, Pascal - general, FORTRAN -

mathematical, COBOL – business oriented.

Functional Paradigm

Model programs as descriptions of mathematical functions. A function is a rule for mapping members of one set (domain)

to members of another set (range). Not sequential, ie. faster on multiprocessor machines. Important concepts: recursive functions, lists, polymorphism,

higher-order functions and equations (thus faster code generation).

Has a variety of data types, including arrays and matrices. Example: sorts can be processed much quicker as a list can

be sorted via vector calculations. Elegant and concise in structure, thus faster code generation. Simple syntax – easy to debug. Learning curve – easy to use for the mathematically inclined. Major uses in building mathematical models and AI. LISP:

(+ 5 6 7) = 18 function (operator) first, then arguments (operands).

APL:5 Æ 2 + 3 = 25 reverse order (right to left), no order of operations.

Logic Paradigm

Logic programming is based on facts and rules. Goal – a query that can result in either Yes (true) or No

(false). Knowledge base – a database containing all the facts and

rules. Inference engine – the control mechanism that applies

knowledge, contained in a knowledge base, to resolve goals. The result being a fulfilment or failure of the goal.

Recursion is used in the logic paradigm (can often result in a stack error).

Software Notes - Shihab Hamid

Strategies to resolve goals: Backward chaining – assume the theory is true and then ask

questions to systematically verify the rules are present. Forward chaining – start from the beginning of the facts and

rules and ask questions to determine which path to follow next to arrive at a conclusion.

Used in databases, knowledge bases and AI. Simple and logical syntax and structure – although, it may

become hard to debug if complex rules are defined. Learning curve – easy for beginners with very little previous

experience in imperative programming as they are more open-minded to the logic paradigm.

Prolog:eat(lion,dog) factgrandmother(A,B):-mother(C,B),mother(A,C) rule?-eat(lion,dog) goal

Object Oriented Paradigm

Focus on objects in the system rather than on system’s function. Objects (self-contained modules) are less vulnerable than functions to changes in the system specification.

Object – any item which can be described by specifying its attributes or fields and the procedures that can be performed on these attributes. An object contains methods (procedures) and attributes (data). Eg. Mr Nice.

Class – the definition of a category of objects. The class defines all the common attributes and methods of the different objects that belong to it. Eg. Goodie.

Encapsulation – the process of hiding an object’s data and processes from its environment. Only the object can alter its own data, making much easier to debug the overall program.

Inheritance – the ability of objects to take on the characteristics of their parent class of their parent class or classes. Inheritance encourages modularity and robust code. Eg. All Goodies have Health attribute and Smile procedure.

Abstraction – the process of picking out the common features of objects and procedures so that each procedure can be dealt with in isolation. Encapsulation and inheritance greatly assists in the process of abstraction as they allow us to put the overall problem aside with confidence whilst sub-problems are dealt with.

Polymorphism – the ability to appear in many forms, ie. a runtime method can process data differently depending on the number of parameters, type of parameters, etc.

Constructor – used to initialise attributes to a particular value. The name of constructor method is the same as the class name.

Software Notes - Shihab Hamid

Modules can be tested individually with the use of drivers. Simpler to test the individual parts rather than the compiled program in one go.

Modular programs are much easier to maintain as only the problem specific modules need to be updated.

Code generation is much quicker in the hierarchical class-structure as there is less occurrences of redundant code.

Learning Curve – programmers of imperative languages will be able to quickly grasp the concepts of OOP as it seems to follow the imperative paradigm with a much more modular approach to programming.

C++:class goodie { int health attribute goodie constructor void smile() method};