Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
Structured Analysis &Structured Analysis &Structured DesignStructured Design
<CFG Generator><CFG Generator>
200811416 200811416 김영훈김영훈
200811441200811441 윤동민윤동민
200811452 200811452 이희봉이희봉
200811458 200811458 조원진조원진
Team 4
ContentsContents
Structured AnalysisStructured Analysis
Statement of PurposeStatement of Purpose
System System Context DiagramContext Diagram
Event ListEvent List
DFD(Data Flow Diagram)DFD(Data Flow Diagram)
Data DictionaryData Dictionary
Process Process SpecificationSpecification
Structured DesignStructured Design
Structured Charts Structured Charts –– Transform AnalysisTransform Analysis
Structured Charts(Basic)Structured Charts(Basic)
Structured Charts(Advanced)Structured Charts(Advanced)
2/26
Statement of PurposeStatement of Purpose
코드를코드를 입력입력 받아서받아서 CFGCFG를를 출력시키는출력시키는 프로그램이다프로그램이다..
Text File Text File 의의 내용은내용은 CC소스코드소스코드 이외에는이외에는 고려고려 하하지지 않는다않는다..
잘못된잘못된 형태의형태의 명령어명령어를를 입력하면입력하면 도움말을도움말을 출력한다출력한다..
변환되어변환되어 그려진그려진 CFGCFG를를 통해서통해서 코드를코드를 최적화최적화 할할 수수있다있다..
3/26
Statement of Purpose(Cont.)Statement of Purpose(Cont.)
제약조건제약조건
입력입력 받는받는 코드의코드의 크기는크기는 100~200100~200줄줄 내외의내외의 프로프로그램을그램을 대상으로대상으로 한다한다. .
Main FunctionMain Function을을 포함하는포함하는 코드코드 여야여야 한다한다..
단일단일 파일로파일로 되어되어 있는있는 코드에코드에 대하여대하여 작동한다작동한다. .
사용자가사용자가 정의한정의한 헤더를헤더를 사용한사용한 파일에파일에 대해서는대해서는 작작동하지동하지 않는다않는다..
포인터를포인터를 사용하지사용하지 않는않는 코드를코드를 대상으로대상으로 한다한다..
4/26
System Context DiagramSystem Context Diagram
CFGPrint
CFGGenerator
Control
CFGGenerator
Control
MessagePrint
Text Input
Command Input
CFG List
Message
5/26
Text File&Command
Event ListEvent List
Input / Output Event
Description
Text Input Check the Text contents
CFG List Output Print commands to the CFG Print
Command Input Check the command
Message Output Print commands to the Message Print
Text File&Command
CFGGenerator
Control
Message
MessagePrint
CFG Print
Command Input
Text Input
CFG List
6/26
DFD Level 0DFD Level 0
TextInformation
CFG Print
CFGGenerator Control
CFG List
MessagePrint
CommandInformation Command Input
Message
Text Input
7/26
Data DictionaryData Dictionary
Input / Output Description Type
Text Input CFG to be converted into C code name .txt files with the extension.
.txt
CFG List Print commands to the CFG Print Char*
Command Input Check the command Char*
Message The received message is output Char*
8/26
DFD Level 1DFD Level 1
Text InformationInterface
1.1
CommandInformationInterface
1.2
Command Input
Text
Command
Text Input
CFGGenerator Control
1.3
Message Print
Interface1.5
CFGPrint
Interface1.4
CFG Command
Message Command
CFG List
Message
9/26
Data DictionaryData Dictionary
Input / Output Description Type
Text Check the Text contents Char*
Command A string containing the command Char *
CFG Command Distinct node and edge information is passed
Char[]Char*[]
Message Command Distinct message to convey information
A(StartMessage)/!A(End Message)/C(Success Message)/!C(Fail Message)/Cmd/!Cmd(Help Message)
10/26
DFD Level 2DFD Level 2
CFGGenerator Controller
1.3.1
MakeBasic Node List1.3.2
MakeEdgeList1.3.4
Success Message 1.3.5
Fail Message1.3.6
Trigger
Command
Make Not
Basic NodeList1.3.3
Help Message1.3.7
Start Message1.3.8
End Message1.3.9
Text
Trigger
Trigger
Trigger
Trigger
Trigger
Trigger Trigger
Make Basic Command
Make Not Basic Command
Make Edge Command
Success Command
Fail Command
Help Command
Start Command
End Command
11/26
Data DictionaryData Dictionary
Input / Output Description Type
Make Basic Node Command
Basic node is stored in an array Char[]
Make Not Basic Node Command
Not Basic node is stored in an array
Char[]
Make Edge Command
Edge is stored in an array Char*[]
Success Command The success of the command is passed
Char*
Fail Command Enter the file fails to pass Char*
Help Command Deliver help message Char*
Start Command Analysis of the program began and it is passed
Char*
End Command Analysis of the program is over and it is passed
Char*12/26
DFD Level DFD Level 33
CheckCommand Cmd : Command
C : C codeA : AnalysisB : Basic blockE : Edge
STOP
Check C Code
Make BasicNode List
Make Edge List
Make Not Basic Node
List
AnalyzeC Code
/Check Command[ Cmd ]/ Check C Code
[ C&&A ]/ Analyze C CodeTrigger “Success Message”Trigger “Start Message”
[ !C ]/ STOPTrigger “Fail Message”
[ !Cmd ]/ STOPTrigger “ Help Message”
[ E ]/ Make Edge List
/ Analyze C Code
[ !B && !E ]/ Make Not Basic Node List
/ Analyze C Code
/ Analyze C Code
[ B ]/ Make Basic Node List
[ !A ]/ STOPTrigger “End Message”
13/26
DFD DFD –– OverallOverall
Text InformationInterface
1.1
CommandInformationInterface
1.2
Command Input
Command
Text Input
CFGGenerator Controller
1.3.1
MakeBasic Node List1.3.2
MakeEdgeList1.3.4
Success Message 1.3.5
Fail Message1.3.6
Make
1.3.3
Make NotBasic NodeList1.3.3
Help Message1.3.7Start
Message1.3.8
End Message1.3.9
Message Print
Interface1.5
CFGPrint
Interface1.4
CFG List
Message
Make Basic Command
Make NotCommand
Make Edge Command
Success Command
Fail Command
Help Command
Start Command
End Command
Trigger
Trigger
Trigger
Trigger
Trigger
Trigger
TriggerTrigger
Text
14/26
Process SpecificationProcess Specification
Reference No. 1.1
Name Text Information Interface
Input Text Input
Output Text
Process Description After receiving Text Input, it sends to CFG generator control
Reference No. 1.2
Name Command Information Interface
Input Command Input
Output Command
Process Description After receiving Command Input, it sends to CFG generator control
15/26
Process SpecificationProcess Specification
Reference No. 1.3.1
Name Main Control
Input Text, Command
Output Trigger
Process Description It is main control that Receive basic information then makes Node List, edge List and printed Message.
Reference No. 1.3.2
Name Make Basic Node List
Input Trigger
Output CFG Command
Process Description Create a list of Basic Node.
16/26
Process SpecificationProcess Specification
Reference No. 1.3.3
Name Make Not Basic Node List
Input Trigger
Output CFG Command
Process Description Create a list of Not Basic Node.
Reference No. 1.3.4
Name Make Edge List
Input Trigger
Output CFG Command
Process Description Create a list of edges.
17/26
Process SpecificationProcess Specification
Reference No. 1.3.5
Name Success Message
Input Trigger
Output Message Command
Process Description After successful input, the success message is printed.
Reference No. 1.3.6
Name Fail Message
Input Trigger
Output Message Command
Process Description After not successful input, the fail message is printed.
18/26
Process SpecificationProcess Specification
Reference No. 1.3.7
Name Help Message
Input Trigger
Output Message Command
Process Description The statement has been entered incorrectly, help is printed.
Reference No. 1.3.8
Name Start Message
Input Trigger
Output Message Command
Process Description Conversion is started.
19/26
Process SpecificationProcess Specification
Reference No. 1.3.9
Name End Message
Input Trigger
Output Message Command
Process Description After create the report, the file name will be printed.
Reference No. 1.4
Name CFG Print Interface
Input CFG Command
Output CFG List
Process Description After receiving CFG Command, it sends CFG List to CFG Print in order to print CFG List
20/26
Process SpecificationProcess Specification
Reference No. 1.5
Name Message Print Interface
Input Message Command
Output Message
Process Description After receiving Message Command, it sends Message to Message Print in order to print Message
21/26
Structured ChartStructured Chart--Transform AnalysisTransform Analysis
Text InformationInterface
1.1
CommandInformationInterface
1.2
Command Input
Command
Text Input
CFGGenerator Controller
1.3.1
MakeBasic Node List1.3.2
MakeEdgeList1.3.4
Success Message 1.3.5
Fail Message1.3.6
Make
1.3.3
Make NotBasic NodeList1.3.3
Help Message1.3.7
Start Message1.3.8
End Message1.3.9
Message Print
Interface1.5
CFGPrint
Interface1.4
CFG List
Message
Make Basic Command
Make NotCommand
Make Edge Command
Success Command
Fail Command
Help Command
Start Command
End Command
Trigger
Trigger
Trigger
Trigger
Trigger
Trigger
TriggerTrigger
Text
Efferent Flow(Output)
Central Transformation
(Control)
Afferent Flow(Input)
22/26
Structured ChartStructured Chart--Transform AnalysisTransform Analysis
Input
(Afferent Flow)
Process
(Central Transformation)
Output
(Efferent Flow)
Control
Input
-Text-Command
Process
-Main Controller
Output-CFG Print Interface-Message PrintInterface
23/26
Structured Charts Structured Charts ––CFG Generator(Basic)CFG Generator(Basic)
Main
Controller
Start
Message
End
Message
Help
Message
Fail
Message
Success
Message
Make Not Basic Node
List
MakeBasic Node
List
Make Edge List
Trigger
Command Information Interface
TextInformation Interface
TriggerTriggerTrigger TriggerTrigger
Trigger
Trigger
Text Command
24/26
Structured Charts Structured Charts ––CFG Generator(Advanced)CFG Generator(Advanced)
Main
Controller
Command Information Interface
TextInformation Interface
Start
Message
End
Message
Help
Message
Fail
Message
Success
Message
Make Not Basic Node
List
MakeBasic Node
List
Make Edge List
Trigger
TriggerTrigger
Trigger Trigger
Trigger
Trigger
Trigger
Text
Command
25/26
The EndThank you