10 Nov 1.HW 3 Remember to submit a.jsp file: for a valid int for an int with errors that produces the java program 2.Structure clashes 3.HW 4: Backtracking.

Slides:



Advertisements
Similar presentations
DT266/2 Information Systems COBOL Revision. Chapters 1 & 2 Hutty & Spence Divisions of a Cobol Program Identification Division Program-ID. Environment.
Advertisements

Module 3: Business Information Systems
Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
CSCI 6962: Server-side Design and Programming Input Validation and Error Handling.
Chapter 3: Modules, Hierarchy Charts, and Documentation
An Introduction to Java Programming and Object- Oriented Application Development Chapter 8 Exceptions and Assertions.
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Chapter 1: Introduction
Requirements and Design
Structure clashes and program decomposition
March 15, 2004CS WPI1 CS 509 Design of Software Systems Lecture #8 Monday, March 15, 2004.
Chapter 7Louden, Programming Languages1 Chapter 7 - Control I: Expressions and Statements "Control" is the general study of the semantics of execution.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Process Specifications and Structured Decisions Systems Analysis and Design, 8e Kendall.
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
Chapter 9 Describing Process Specifications and Structured Decisions
Unit 211 Requirements Phase The objective of this section is to introduce software system requirements and to explain different ways of expressing these.
System Design and Analysis
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
Chapter 1 Program Design
Introduction to C Programming
PowerPoint Presentation by Charlie Cook Copyright © 2004 South-Western. All rights reserved. Chapter 9 Controlling Information Systems: Process Controls.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Equivalence Class Testing
Chapter 6: Functions.
11 Chapter 4 LOOPS AND FILES. 22 THE INCREMENT AND DECREMENT OPERATORS To increment a variable means to increase its value by one. To decrement a variable.
System Analysis Overview Document functional requirements by creating models Two concepts help identify functional requirements in the traditional approach.
Introduction to Systems Analysis and Design Trisha Cummings.
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
CHP - 9 File Structures. INTRODUCTION In some of the previous chapters, we have discussed representations of and operations on data structures. These.
Structured COBOL Programming, Stern & Stern, 9th edition
Managing the development and purchase of information systems (Part 1)
Chapter 9 Describing Process Specifications and Structured Decisions
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Intro to Architecture – Page 1 of 22CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: Introduction Reading: Chapter 1.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
1 Relational Expressions Relational expressions: –Expressions that compare operands –Sometimes called conditions –Evaluated to yield a result –Typically.
 Java has the logical operators and, or, and not, symbolized by &&, ||, and !, respectively.  Logical or means one or the other or both conditions hold.
By the end of this session you should be able to...
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Software Development Cycle What is Software? Instructions (computer programs) that when executed provide desired function and performance Data structures.
Selection Control Structures. Simple Program Design, Fourth Edition Chapter 4 2 Objectives In this chapter you will be able to: Elaborate on the uses.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 3 1 Software Size Estimation I Material adapted from: Disciplined.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Chapter 9 Controlling Information Systems: Application Controls.
Pseudocode Algorithms Using Sequence, Selection, and Repetition
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
1 Boundary Value Testing Chapter 5. 2 Introduction Input domain testing is the most commonly taught (and perhaps the most commonly used) software testing.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
22 Nov 1.Comments on HW3 2.Java I/O – Exception handling 3.Inversion 4.JSD.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
A FIRST BOOK OF C++ CHAPTER 14 THE STRING CLASS AND EXCEPTION HANDLING.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Copyright © 2011 Pearson Education Process Specifications and Structured Decisions Systems Analysis and Design, 8e Kendall & Kendall Global Edition 9.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
8 Nov 1.Backtracking 2.Structure clashes & program decomposition.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
FLOW CHARTS IN PROCESS DESCRIPTION FRANK CHINGARANDE.
7-Nov Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Oct lecture23-24-hll-interrupts 1 High Level Language vs. Assembly.
Design methods: JSP and JSD†
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 3 The DATA DIVISION.
Chapter 5: Software effort estimation- part 2
1) C program development 2) Selection structure
Java Programming Control Structures Part 1
Chapter 11 Describing Process Specifications and Structured Decisions
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Presentation transcript:

10 Nov 1.HW 3 Remember to submit a.jsp file: for a valid int for an int with errors that produces the java program 2.Structure clashes 3.HW 4: Backtracking Exercise

Data structure for a well-formed Integer

Possible errors We want the error messages to be useful. What are the different possible errors? 1.Start with non-sign, non-digit 2.Signed integer i.Non-digit immediately after sign ii.Non-digit in digit body 3.Unsigned integer i.Non-digit in digit body

Data structure for identifier with possible errors

Simple Programs The design method described above applies only to a class of "simple programs'. A 'simple program' has the following attributes: 1.The program has a fixed initial state; nothing is remembered from one execution to the next. 2.Program inputs and outputs are serial files. There may be more than one input and more than one output file. Each input and output file associated with the program is a tree structure and can be described with a grammar for regular expressions The input data structures define the domain of the program, the output data structures its range. Nothing is introduced into the program text which is not associated with the defined data structures. 3.The data structures are compatible, in the sense that they can be combined into a program structure as we done previously –The program structure derived from the data structures is sufficient for a workable program. –Elementary operations of the program language (possibly supplemented by more powerful or suitable operations resulting from bottom-up designing) are allocated to components of the program structure without introducing any further 'program logic'.

More complex programs: Structure Clashes Three types of structural clash: 1.Boundary clash (physical blocks on input don’t coincide with logical groups on output) 2.Ordering clash (wish report sorted by named, input is unsorted) 3.Interleaving clash (wish to produce report of user job times, inputs are interleaved)

Boundary clash example: An accounting program may have a boundary clash between an input file structured by months and an output file structured by weeks. from Jackson JSP In Perspective (2001)

Examples: Boundary Clashes Boundary clashes: The calendar consists of years, each year consisting of a number of days. In one structure the days may be grouped by months, but by weeks in another structure. There is a boundary clash here: the weeks and months can not be synchronised. A chapter of a printed book consists of text lines. In one structure the lines may be grouped by paragraphs, but in another structure by pages. There is a boundary clash because pages and paragraphs can not be synchronised. A file in a low-level file handling system consists of variable-length records, each consisting of between 2 and 2000 bytes. The records must be stored sequentially in fixed blocks of 512 bytes. There is a boundary clash here: the boundaries of the records can not be synchronised with the boundaries of the blocks.

Solution to Structural Clashes General view of problem Structure diagram Solution: program decomposition Program decomposition There is no structure clash between A and I, so the structure of PA can be constructed without difficulty; the same is true of I and X and PB

Processing - general view: 1.Batch processing ( пакетная обработка данных) 2.Parallel processing 3.Quasi-parallel processing (program inversion) program inversion

Program Inversion инверсия программов We wish to design PA and PB independently of each other so that the structure of each is based on the data structure representation of its own problem environment. Program inversion is a purely mechanical transformation of the independent programs, PA and PB, into a main program and subroutine The subroutine has a single ENTRY point and stores its return address within its state vector so that it is resumable.

HW 4: Backtracking Exercise Warehouse (товарный склад) A warehouse records a transaction for every item received into or issued out of the warehouse: Transaction: 0-3 Item code 4‘+’ (in), ‘-’ (out) 9-10 initialization (контроль)

Backtracking Exercise: Warehouse (товарный склад) At the end of the day, the transaction file is sorted by item number, and a "Daily Net Movement Summary" showing the net movement of each item into or out of the warehouse is produced as shown below: Daily Summary A A Z End Summary

Backtracking Exercise: Warehouse (товарный склад) 1. However, parts are to be included on the report only if every shipment and order transaction has been properly verified, as indicated by a code in the initials field on each transaction record. 2.Parts with one or more unverified shipment or order transactions, indicated by a blank in the initials field, should be written on an error listing; they are not to be included in the report (no total line should be generated).

Backtracking exercise We don't know how many shipment and order transactions exist for any part number. –Thus, we don't know how many records we have to read in order to recognize whether we have a part all of whose shipments and orders have been verified. –Need to use backtracking Develop solution in 3 stages, creating a.jsp file for: –Stage 1 (ignoring the recognition difficulty –Stage 2 (using posit and admit) –Stage 3 (taking care of side effects) –Elaborated program structure