IB Computer Science

From testwiki
Revision as of 07:58, 25 February 2008 by imported>MarkHayes (6 Further System Fundamentals: added sub-headings)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Back to International Baccalaureate

Systems Life Cycle and Software Development

Systems Life Cycle

System Life Cycle Stages

The systems life cycle can be broken down into five cycles: Analysis, Design, Implementation, Operation, and Maintenance.

  • Analysis – The designers meet with the users to determine exactly what the user wants, and undertake feasibility studies (whether it is possible for the designers to meet the user's expectations.
  • Design – In this stage, the programmers develop the solution to the user's problem. This can be the most time-consuming part of the cycle, since there are many choices that needs to be made.Decision must be made on the types of software, hardware and on the algorithms that are going to be used,
  • Implementation – The designed system is delivered to the user (gradually replacing the old system), and all the bugs that arise should be fixed. Users are trained on how to use the program in this stage as well.
  • Operation - In this stage, the user operates the program, and the user (or a design bureau representative) keeps track of the complaints about the system.
  • Maintenance – Basically this stage ensures that the system continues to match the user's expectations, bugs and/or flaws might arise with time and thus the system needs to be fixed and updated. Usually this is done through user feedback-driven updates, where the log (mentioned in "operation") is given to the designers to incorporate into the next versions of the system.

Importance Of Collecting Data

The analysis stage of gathering data is essential because you can gain clear insight into data input, processing and output without thinking about the computer system that may eventually be used.

Methods Of Data Collection

  • Interviews - Detailed data, can change questions during process (not like questionnaire). Time-consuming, problems classifying/quantifying data
  • Questionnaires - Can reach a lot of people, quickly (comp to interview/observation); Numerical analysis possible.

Questions may be mis-interpreted; people may not respond at all or may do only some questions.

  • Document search - The data required for the system can be identified accurately. Documents may be lacking, out-of-date etc (interview could discover this)
  • Literature search - Can find descriptions/problems of previous implementations (saves work). Problem may not be described (or in detail). Again, working without experienced users.
  • Observation - Observations are independent of user bias (unlike interview/questionnaire). Time consuming and observer can affect process Hawthorne Effect.

Production of Requirement Specification

This may include: a definition of inputs and outputs, a list of tools, facilities, people available for developing the solution and a schedule for the next stages of the project.

Feasibility Report

Advantages and Disadvantages Of Alternative Solutions

Methods Of Testing Systems

Methods Of Implementing New Systems

Importance Of Maintaining Systems

System Analysis

Importance of Formulating A Problem Precisely

In order to create a good solution is it is vital to understand what the problem is, so that the solutions are all focused towards it. There might be team of specialists that work on the problem; and all of them must be fully concern about the issue. Furthermore the user of the system often knows the matter perfectly and he must be interviewed so that he can provide a good description of his requirements. There is also am economic concern, since the cost of the system is directly proportional to the benefits is will provide, all this information should be than written in feasibility report. Lastly the most important thing of all; a system must be tested continuously to see if it satisfies all the requests, is not possible to test a system without knowing what it was supposed to do.

Aspects In A Considered Problem

Various aspects are to be considered in finding a solution to a specific problem. This intial phase of analysis in systems can also be called 'fact finding'. The reason for this analysis is for the purpose of determining what aspects of the problem can be solved by computer means, whether the solutions have been used in the past to solve a similar problem, or what the costs may be in generating a solution, for example. Additionally information can be found such as how much time it may take to install a new system, and the responsibilities given to various persons in the development team.

All of the information that must be obtained, as described above, can be found through conducting interviews, or sending out questionnaires to employees in a company for example. The development team may also look up a history of the organization to see what information is available about the current system through existing documents. Research into other sources with different solutions to a similar problem and the observation of employees working under the existing system can also be investigated. Obviously, these methods of analysis are used at the development team's discretion, since they all have advantages and disadvantages (see topic 1.2.3 for more)

Appropriate Solution

Parts That Can Be Solved Using A Computer

Three Basic Control Aspects

Analysation By Modules

System Design

Parts Of A System

The main parts of any computer system follow the input-process-output model of data flow.

Data That Needs To Be Processed

Suitable Means Of Data Capture

Design Data Structures

Hardware Components

Suitable Interface

System Flowchart

Construct System Flowchart

Social Significance

Social Implications

Discuss Social Implications

Software Life Cycle

Major Stages

Cyclical nature of software production

Computers systems are used over long periods of time. The software in these systems requires periodic improvement. After the original design and implementation, further analysis, redesign and restructuring are required to accommodate changing needs. This will continue through many cycles of analysis, design, implementation and use.

Software Design

Data Required

Modularity

Modularity is a concept that has applications in the contexts of computer science, particularly programming, as well as cognitive science in investigating the structure of mind. A module can be defined variously, but generally must be a component of a larger system, and operate within that system independently from the operations of the other components.

Modularity in Computer Science

Modularity is the property of computer programs that measures the extent to which they have been composed out of separate parts called modules. A modular approach to programming is gaining popularity in fields of artificial intelligence systems integration, where a large-scale general A.I. system is composed of modules that each serve a specific purpose and communicate with each other to produce the system's overall behavior. Programs that have many direct interrelationships between any two random parts of the program code are less modular than programs where those relationships occur mainly at well-defined interfaces between modules.

Prototyping

Prototyping is the process of quickly putting together a working model (a prototype) in order to test various aspects of a design, illustrate ideas or features and gather early user feedback. Prototyping is often treated as an integral part of the system design process, where it is believed to reduce project risk and cost. Often one or more prototypes are made in a process of incremental development where each prototype is influenced by the performance of previous designs, in this way problems or deficiencies in design can be corrected. When the prototype is sufficiently refined and meets the functionality, robustness, manufacturability and other design goals, the product is ready for production.

see prototyping for a more detailed explaination

Prototyping Approach

End Users

The end user is a popular concept in software engineering, referring to an abstraction of the group of persons who will ultimately operate a piece of software (i.e. the expected user or target-user). This abstraction is meant to be useful in the process of designing the user interface, and is therefore built on a relevant subset of any user's characteristics which may include which computer interfaces he/she is comfortable with (having used them before or because of their inherent simplicity), his/her technical expertise and degree of knowledge in specific fields or disciplines, and any other information which is believed to be relevant in a specific project. When little constraints are imposed on the end-user category, i.e. when writing/publishing programs for the general public, it is common practice to expect minimal technical expertise or previous training in the use of computer interfaces. This is also the general meaning associated with the term end user (see also Luser). In this context, intuitive GUIs (possibly with a touch interface) are usually preferred over more sophisticated command line interfaces for the sake of usability.

Efficiency

Debugging

Tools Of Debugging

Documentation

Need Of Documentation

It will be very important that the documentation supplied with the original system is clear and complete. This documentation will be used to make it easier to design modifications to the system.

Features For Design

Features For User

Program Construction in Java

Computing System Fundamentals

Computer Translators

Syntax and Semantics

The Function of High-Level Translators

Software Development Tools

Computer Architecture

Computer Systems

Networked Computer Systems

Data Representation

Binary Data Representation

The Binary System is a base 2 counting system, thus, only two digits are used to represent numbers, 0 and 1. A binary number is a sequence of 0’s and 1’s.

These 0’s and 1’s are referred to as states of voltages. There are two states and two states alone of voltages, the 0’s and the 1’s. This is because binary systems have a base of two, hence it only accepts two different digits.

As you probably know, there are 8 bits in a byte. But how many people actually know what a bit is? A bit is a single 0 or 1 in a binary system.

Binary code is usually separated when written into bytes. For example: 0100 1011 0100 0010

There are many different sequences that can be created using binary. However there is a difference between the sizes of the sequences. For example if you would like a small number of combinations available, to save memory (RAM) you wouldn’t want more bits than necessary. Here are some examples of relationships between how many bits used, and the number of different combinations:

2 ^ 2 = 4 Different combinations 2 ^ 3 = 8 Different Combinations 2 ^ 4 = 16 Different combinations

Need for Standard Formats for Documents and Graphics

Over the years, many different formats for storing data have been developed; partly due to the fact that different applications have different features and manipulate data differently. However, due to the large versatility of software available in the market, a standard is needed in order to be able to convert formats between programs. There are now different standards available for different types of media or data: • .gif for diagrams on Web pages • .jpeg for photos in programs as well as on the internet • .wav for sound files

Such standards also exist for text files: ASCII. This code uses 8-bit fragments to represent letters and numbers. Although this format is useful for regular use of English, it’s not as useful when it comes to other languages since it only allows for 255 different characters. This is why nowadays more universal standards are used for the Web and different operating systems (e.g. ISO Latin 1)

Express Numbers in Decimal, Binary and Hexadecimal

Decimal: The decimal number system uses the base of ten to compute values. The right-most digit is multiplied by 10^0, the next digit to the left is multiplied by 10^1, the next digit to the left is multiplied by 10^2, and so on.
For example:

                  256 = 2*10^2 + 5*10^1 + 6*10^0  
                      = 200    + 50     + 6 
                      = 256

When representing fractional decimal values, the number immediately to the right of the decimal point is multiplied by 10^-1, the next by 10^-2, and so on. Note that for the fractional part, the exponents start with one, not zero.
For example:

                0.123 = 1*10^-1 + 2*10^-2 + 3*10^-3  
                      = .1      + .02     + .003 
                      = 0.123

Binary: Unlike decimal with a base of ten, binary has a base of 2 which permits only two digits, 0 and 1. Each binary digit within a binary number has a value associated with its position in the number. Starting with the least-significant digit on the right and moving to the left, the values are 2^0, 2^1, 2^2, 2^3, and so on.
For example:

               100111 = 1*2^5 + 0*2^4 + 0*2^3 + 1*2^2 + 1*2^1 + 1*2^0
                      = 32    + 0     + 0     + 4     + 2     + 1
                      = 39

With fractional binary numbers, the pattern is similar except the powers for the fractional portion of the number are negative, and they begin with one (not zero), like so: 2^-1, 2^-2, 2^-3, and so on.
For example:

               111.11 = 1*2^2 + 1*2^1 + 1*2^0 + 1*2^-1 + 1*2^-2 
                      = 4     + 2     + 1     + 0.5      + 0.25 
                      = 7.75

Hexadecimal: The hexadecimal system uses a base of 16 allowing numbers 0-9 and letters A-F; A-F represent 10-15. Each hex digit within a hex number has a value associated with its position in the number. Starting with the least-significant digit on the right and moving to the left, the values are 16^0, 16^1, 16^2, 16^3, and so on.
For example:

                1DF3 = 1*16^3 + D*16^2 + F*16^1 + 3*16^0
                     = 1*4096 + 13*256 + 15*16  + 3*1
                     = 4096   + 3328   + 240    + 3
                     = 7667

Convert Numbers between Decimal, Binary and Hexadecimal

Decimal To Binary: The conversion from decimal to binary can be done using a simple method described below. The decimal number is broken up and a conversion table is used. The example is below:

Integer: 5

Binary:

1 2 4 8

1 0 1 0

Thus the binary number for 5 is 0101 (Written in Reverse).

Binary To Decimal: The conversion from binary to decimal is done the same way as above. Before they are laid onto the table, the values are reversed and then converted.

Binary: 0101

Decimal:

1 0 1 0

1 2 4 8

Thus the decimal is: 1 + 4 = 5.

Decimal To Hex: The conversion from Hex is done using a base system. The system is the same except a base 16 is used. The number is divided by 16 and the remainders are taken. The remainders are combined into hex. Example:

Decimal: 256

Divison------------------------------Result--------------------------Hex

  256/16                16                0
  16/16                 1                 0
  1/16                  0                 1

Thus the Hexadecimal is: 100.

Represent Integers as Binary Using Twos Complement

2’s complement is a variation of the binary number system. It is read the same way as a binary number system, except that the first bit in the sequence (the largest number) is negated. It is used to represent negative numbers. A simple way to write a 2’s complement variation of a binary number (i.e negate the binary number) is to invert the bits (replace all the 0 with 1, and vice versa) and then adding 1 to the inverted sequence.

For example: 1000000 (in binary) = 128 (in decimal). To represent -128, invert the bits. 10000000 becomes 01111111 (127 in decimal), and then add 1 to the binary sequence: 01111111 + 1 = 1000000

That number, in 2’s complement, represents -128 in decimal.

Define Analog Data and Digital Data

Analog data is a type of data that is represented by some sort of continuous illustration, such as a wave. Analog data represents different values and everything in between them. This representation could symbolize a sound level, color intensity or other real-life examples.

Digital data is a type of data is is represented by discrete values. It is not continuous, like a wave, meaning it can only replace fixed values, such as the number of apples in a basket, players in a soccer team, etc... Computers use a binary system to store information; this system is composed of 1s and 0s, which replace on and off values.

Most data in the real world is analog, however, with today's growing technology, some data has to undergo a conversion to be implemented into computers or stored on a CD. Unfortunately, since digital data is not continuous, the conversion from analog results to a certain loss of precision or information. To convert analog into digital, computers use a technique called 'sampling' (refer to Section 3.5.8). Conversion will be addressed in the following Sections.

for more information: Digital: [1] Analog: [2]

Convert Data Between Analog and Digital Formats

Applications of Conversion

There are several applications of conversion; however this section will explain only a few. Analog is always used for what is in our natural environment. What we are used to such as music, video, and pictures. However, for this to be stored accurately and carefully (with much detail) into computers, this analog data must be converted to digital. Digital representation is stored in binary, either 1 or 0, and is often sent that way. For example, sound waves like either music or someone speaking on the phone, will be sent by digital representation, but then converted to analog to be heard by someone half way around the world. Even with music, you hear analog through your speakers but get the music with digital. Also, temperature sensing may be read in analog yet written digital to be shown to the readers. The examples are many and used much more than we may think in our everyday lives.

A site that may help further with conversions is: [[3]]

And for more information, visit this other WIKI site: [[4]]

Errors

How Data Errors Occur

Data Errors Can occur in many ways:

Syntax Errors: This can happen by wrong data input, mostly by a typing mistake or malfunction in the input hardware. This can also happen in the programming of software at the programming stage.

Hardware: Errors can occur when a hardware can do a bad write to a disk mostly due to faulty drives or damages. Also External damage can cause corrupted data. Bits can be flipped such as a “0” instead of a “1”.

Deliberate: Deliberate errors occur when someone changes the data if he/she has access to it. This can be through the main entry system or through the form of a virus.

Data Corruption

Preventing and Detecting Errors

Errors will cause less effect the earlier they are detected, so it is crucial that error prevention/detection measures are implemented before the data is transmitted, particularly during data input. There are two categories for error-checking methods: verification and validation. Verification is a process that checks whether the data in the source document is exactly the same as the data inputted to the computer (or the data to be transmitted)., and include such proven methods as proof reading and double entry. Validation is a process that makes sure that the data to be inputted makes sense (i.e follows a certain format), and validation methods include check digits, range checks, picture/format checks, and data type checks.

There are three basic types of errors: logic errors, runtime errors, and syntax errors. Logic errors are caused by faulty logic/algorithm in the program, and can only be prevented by encouraging programmers to use proven algorithms in their programs. Runtime errors are caused by unhandled exceptions (such as file not found, illegal memory access, etc.) and can be prevented by making the program as robust (able handle as many possible exceptions as possible). Syntax errors are caused by bad programming language, and can be prevented by using a compiler before running the program.

Recovery From Errors

Detecting an error is one step; however, for a system to run efficiently, it has to recover from errors. There are three major ways of doing so: re-input, re-transmission and backing up.

Re-input: After errors are detected through validation or verification, they can be fixed simply by correcting the invalid data entered. In a batch process, though, the errors will be reported, and the correct data will have to be entered on the next batch.

Re-transmission: When parity checks catch a transmission error, there will usually be a request for re-transmission. However, some errors can be automatically fixed.

Backing up: When organizations rely on computer-stored data (large companies, banks, government branches, etc…), their systems are thoroughly protected. They create daily backups for each action of the day. Typically, the backups are well protected (fireproof case, and other such measures) and kept in a different location than the data for security reasons, since that information is key to running the business. There are two types of backups. Full backups save a new copy of every file in the system. Incremental backups save only new files or others that have been modified. Most commonly, backups are stored in tape, due to the medium’s cheap price and large storage capabilities.

Utility software

Functions For Utility Software

There are a number of functions for specific utility software. For example a file manager will allow you to: - Copy - Delete - Rename - Create folders - Search files - Backup data - Restore data - Format a disk

These are some of the functions that a basic file manager software is capable of. A variety of utility programs are available for a range of different functions.

A disk defragmentation utility arranges data on the hard drive such that the disk can function in a more reliable and faster way. It does this by combining the various portions of the file such that the file occupies a contiguous space on the disk. Although the file manager tries to store files in an efficient way, over time, files will inevitably become fragmented. A 'defrag' utility is usually invoked as needed.

Data compression is a very simple yet important tool for a computer. It has two primary functions: save space on the disk, and save time when transmitting data, such as uploading or downloading files to a server on the Internet.

A virus checker (anti-virus utility) scans files on the disk looking for viruses. If a virus is found in a file, it may be possible to 'clean' the file. If the virus cannot be removed form the file, the infected file may have to be deleted. The virus scanner can also check incoming files such as email attachments to ensure that the attachments do not contain viruses. An anti-virus utility will usually have an associated pattern file which contains a list of all the viruses that the scanner is capable of detecting. The pattern has to be kept up to date, and most virus utilities can automatically download the latest pattern file from the vendor.

There are many types of utility software but these are the main ones. Utility software are created and are edited by users all the time.

Need for the above utility software

‘Utility software’ refers to system software that is used to manage data, or perform some sort of check on data such as: data compression, scanning for viruses, managing files, and defragmenting files.

File managers are used to copy, rename, and delete files, create folders, and backup data. Backup is important because it not only organizes but also saves the important information for users.

Defragmentation is needed because it can improve performance. Ideally, a file will be stored contiguously on the disk. Oftentimes, files will be split into two or more pieces because there is not enough contiguous free space to store the entire file in one place. When this occurs we say that the file is fragmented. Accessing a fragmented file will take longer than accessing a non-fragmented file because the read/write head on the disk drive will have to move to several places to access the contents of the file. Defragmentation utilities rearrange the data on the disk in an attempt to minimize the amount of file fragmentation, thus, improving I/O performance.

Data compressors help to increase data transfer speed, make storing data easier, and save storage space. For example, an image of a blue background and one flower can be reduced from 90,000 bytes to 3 bytes! Compression ratios are not always this dramatic, but invariably compression does save space.

Virus checkers are used to detect unfriendly software before it destroys, deletes, or damages the software on your computer. This is very important in settings like banks and hospitals.

Computer Maths and Logic

Number systems and representations

Boolean logic

Abstract Data Structures and Algorithms

Fundamentals

Static data structures

Dynamic data structures

Objects in problem solutions

Recursion

Algorithm Evaluation

Efficiency of Algorithms

To optimize algorithms, one must first know whether a certain algorithm is better or worse than another one. In this case, better can mean that the algorithm processes data faster or that less RAM is used. To measure data processing speed, one can use Big O notation.

Big O notation is always in the form of O(expression). The expression inside the parentheses is different for different efficiencies. It almost always contains n, the number of items of data to be processed. The Big O notation of a linear search on an array (of size n) is O(n). This means that doubling the array size will, on average, double the time for the linear search to complete.

Big O notation does not, however, indicate exactly how efficient an algorithm is. It only indicates how much the time spent increases when n is very large and is increased. For instance, if a certain algorithm takes 0.5n+2 milliseconds for each item of data, it will still have a Big O notation of O(n). This is because when n gets to, say, one trillion, the added 2 will have almost no effect, so it is discarded. In the same way, all coefficients of n are discarded.

Other examples of Big O notation include O(n2) for bubble and selection sort and O(logn) for binary search. Note that binary search’s Big O notation is logn instead of log2n, because logarithms of different bases increase in approximately the same way when n is large.

Further System Fundamentals

Processor configuration

Magnetic disk storage

Operating systems and utilities

Further network fundamentals

Computer/peripheral communication

File Organization

Links

The main textbook is available at [5]