Steps in Program DevelopmentCovering P1 & M12Translating from High-levelLanguage to BinaryInterpreted: each statement translated as it isexecuted–slow but easy to useCompiled: entire program is converted tobinary–executes faster, but more difficult touse (.exe files are compiled programs)3Total = 0Current = 100do while current 0Total = Total + CurrentCurrent = Current – 1Loop10111000101110001 000000000110010000000001 110010000100100101110101 11111011TranslationProgramHigh levellanguage … Continue reading “Steps in Program Development | My Assignment Tutor”
Steps in Program DevelopmentCovering P1 & M12Translating from High-levelLanguage to BinaryInterpreted: each statement translated as it isexecuted–slow but easy to useCompiled: entire program is converted tobinary–executes faster, but more difficult touse (.exe files are compiled programs)3Total = 0Current = 100do while current 0Total = Total + CurrentCurrent = Current – 1Loop10111000101110001 000000000110010000000001 110010000100100101110101 11111011TranslationProgramHigh levellanguage programMachine languageprogamProcess in building anapplication Analyze the problem and develop the specification. Design the solution-rough outline Develop Outline into Algorithm. Test Algorithm for Correctness Implement the program (code the program) Test the program & Validate the program (furtherextensive testing) to insure it works under allcircumstances. Document and Maintain Program1. Analyze the problem anddevelop the specification Define the problem Inputs
Outputs
Processing steps to produce outputsDefining Diagram InputProcessingOutputInitialize the arrayStart the loopTotalInitialize the sumAdd numbers of the array in sumNum-3Print Total number 2. Design the solution– roughdraft Major processing steps Major subtasks (if any) Major control structures (repetition loops,branches etc) Major variables & record structures Main logic3. Develop Outline intoAlgorithm Pseudocode (form ofFOR each element in thearray Structured English) Nassi-Schneiderman diagram Flowcharts for small partsof programPRINT SumHere is another version of thesame code:INITIALIZE Sum to 0FOR i = 0 to array length – 1ADD array[i] to Sum SET Sum to 0ADD element to SumENDFORENDFORWRITE Sum4. Test Algorithm forCorrectness Desk checking using test dataCode the AlgorithmnumList = [2, 4, 5, 6]def listsum(numList):Sum = 0for i in numList:Sum = Sum + ireturn Sumprint(“The sum in the list is “, listsum (numList))5. Run Program on theComputer Compile Correct syntax errors Run program with test data Correct logic errors6. Test the program & Validate the program(further extensive testing) Test the program
White box testing
Black box testing Extensive testing to insure it works under allcircumstances.
Functional testing
Regression testing7. Document and MaintainProgram On-going task Comments within program – very important in Java Structure charts Solution Algorithm Test data resultsMaintenance often done by other programmers. If programwell designed, code will be easier to maintain12In detail: Document Project in Writing Documentation includes the pictorial and writtendescriptions of the software. It contains internaldescriptions of programming commands and externaldescriptions and instructions. Documentation is necessary since, sooner or later, theprogram will need to be maintained (correct bugs, addnew features, handle problems not thought of previously,etc. This is NOT possible without documentation. Written documentation includes books, manuals, andpamphlets that give instructions on software use anddiscuss the objectives and logic of the software.Algorithm Definition A logical sequence of steps for solving aproblem, …
From http://Dictionary.msn.com Dale and Lewis:
a plan of solution for a problem
Algorithm – An unambiguous (and precise) set of steps forsolving a problem (or sub-problem) in a finite amount of timeusing a finite amount of data.Algorithm Definition, cont Shackelford, Russell L. in Introduction toComputing and Algorithms –
“An algorithm is a specification of a behavioralprocess. It consists of a finite set of instructionsthat govern behavior step-by-step.”Good vs. Bad Algorithms All algorithms will have input, perform aprocess, and produce output. A good algorithm should be:
Simple – relative
Complete – account for all inputs & cases
Correct (Right)
should have appropriate levels of Abstraction. –grouping steps into a single module
Precise
Mnemonic – SCRAPSimplicity Simple can be defined as having nounnecessary steps and no unnecessarycomplexity. (You may lose points if youralgorithm contains unnecessary steps) Each step of a well developed algorithmshould carry out one logical step of theprocess.
Avoid something like: “Take 2nd right after youexit at King Street”It has Levels of Abstraction. From the Oxford English Dictionary,abstraction is defined as:
“The act or process of separating in thought, ofconsidering a thing independently of itsassociations; or a substance independently of itsattributes; or an attribute or qualityindependently of the substance to which itbelongs.”
Example: Add all the scores then divide the sumby the number of students to get the average.Other algorithm attributes A good algorithm should be correct. A good algorithm should be complete. Shackelford again, “To be correct, analgorithm must produce results that arecorrect and complete given any and allsets of appropriate data.” And to be correct, an algorithm must proceedthrough to a conclusion. M1: Steps taken from writing code toexecution, using the scenario described in 1.6above as an example1. Writing the Pseudocode Writing the solution in plain English forexample;Initilise number_of_bounce=1Enter the height of the ball (ht)Start a loop till (ht>0.5):ht=ht*0.7increase number_of_bounce by 1print the number of the ball dropped2. Write the section in the computerlanguage of your choice: Pythonnumber_of_bounce=1ht=float(input(“enter the height of the ball dropped: “))while (ht>0.5):ht=ht*0.7number_of_bounce =number_of_bounce+1print (“The ball dropped “, number_of_bounce, “times”)Testing the code in IDLE You need to provide the snapshots of thecode execution in IDLEDocument the code Comments within program – very importantin Python or any other Language
Structure charts
Solution Algorithm
Test data resultsnumber_of_bounce=1 # Initilising the variable as 1 to count the bounceht=float(input(“enter the height of the ball dropped: “)) # Entering the height of the ball droppedwhile (ht>0.5): # loop started to go on till height is more than 0.5 mht=ht*0.7 # to find the new height after each dropnumber_of_bounce =number_of_bounce+1 # increasing the count of the dropprint (“The ball dropped “, number_of_bounce, “times”) # finally printing the total dropExtra Learning on TestingExtra Learning on TestingTypes of testing: Functional Testing In software development, functional testing relates to the testing of a system’s functionality. Typically the testing of eachfunction is performed independently. Functional testing is generally performed against a specific requirement, providing acheck as to whether it works as it should e.g. does the system do x when y is pressed = yes/no.Types of testing: Regression Testing Regression testing looks at whether software that has previously worked as it should continues to do so after an update orchange has been made. Changes can vary from an update to the actual software e.g. a new version or patch that has beenreleased, or it can be used when an integrated application is added or updated. Regression testing is typically a form offunctional testing but it is specifically focused on looking for new issues and risks in existing functions that have previouslyworked.Types of testing: Compatibility Testing Compatibility testing is a non-functional type of testing which looks at how software performs across a range of devices,operating systems and browsers. To be effective it is recommended to always perform compatibility testing on realenvironments rather than using emulators. With the increasing focus on digital transformation initiatives, compatibility testingis growing in importance, particularly when considering user experience and customer satisfaction.Types of testing: Automated Testing Automated testing refers to a type of testing that uses independant software to test the system being tested. Automated testingcan be used to perform other types of testing such as functional or performance testing. Automated testing lends itself well totesting which is repetitive in nature and can be time-consuming if performed manually e.g. functional regression testing. Thepre-scripted nature of automated testing can enable increased test coverage to be achieved.Types of testing: Smoke / Sanity Testing Smoke testing checks whether fundamental functionality in a piece of software is working. Smoke testing is typically used at anearly stage in the software development lifecycle to determine if the system is stable enough to begin more extensive testing orwhether there are any basic issues that would prevent testing or waste time.Continued…Types of testing: Acceptance Testing Acceptance testing is focused on users’ requirements from a system and checks whether these are satisfied by the system. Toperform acceptance testing a set of acceptance criteria is normally specified to test against, with automated tests often being usedalongside unscripted exploratory testing to better-represent a user’s approach to using the software.Types of testing: Performance Testing Performance testing is a type of non-functional testing (a test level). It can look at the stability, responsiveness and speed of asystem amongst other things. Generally performance testing is carried out in a representative test environment replicating thenumbers of users – often in the hundreds or thousands – anticipated to be using the system concurrently. There are a number of subcategories to performance testing such as stress testing, peak/load testing, and soak testing.Types of testing: Accessibility Testing Accessibility testing is a form of usability testing. In the UK accessibility testing is used to check websites and software areaccessible for people with disabilities including those with disabilities relating to hearing, sight, cognitive understanding and oldage. Those with disabilities often make use of assistive technology such as screen readers so accessibility testing checks that thevarious elements of a page are tagged properly to be read by these technologies.Types of testing: Usability testing Usability testing checks how intuitive and ‘usable’ software is for the end-users. It is generally conducted by real users (rather thanemulators) and is objective-led e.g. find a red jacket on the site and add to your shopping basket, rather than giving a user specificsteps to follow to complete a task. Checklists can also be used to test against recognised usability principles. This type of testing isused to understand just how user-friendly a piece of software is.Types of testing: Security Testing Security testing is a category of testing, performed to identify vulnerabilities in a system and related infrastructure, in order toprotect customer and organisation data, as well as intellectual property. There are a number of different sub-categories to securitytesting such as penetration testing, which aims to identify vulnerabilities which an attacker could exploit from external or internalaccess.