CS342: Software Design

2y ago
10 Views
2 Downloads
746.57 KB
19 Pages
Last View : 1d ago
Last Download : 3m ago
Upload by : Halle Mcleod
Transcription

CS342: Software DesignSeptember 26, 2017

AgendaProject 1 discussion: OverviewCode examplesClass designsTesting for Project 1Different levels of testing

Card Game: Poker - 5 Card Draw

Class dependencyGameComputerPlayerUserPlayerCardCardPile

You may get this when building large scale software.

Player Base class:common fields andmethods for user andcomputer- Add a card to hand- Discard a card- Has flus, has four suit,has etc- Calculate rank- Cal # of cards u candiscard- Get handCard Pile- Shuffle- Deal a cardCard- Number, suit, stringGame Session: mainlogic and workflow- Set up pile- Instantiate Players- Deal to Players- Players replace cards- Decide results andwinnersUser Player- Interactive selectionFive CardDraw (Main):UI and orchestration- Prompt # of players- Trigger dealing- User's turn- AI's turn- Display resultsComputer Player- AI functionCleaner class design

Main function class: orchestration

Main function class: UI

GameSession class: game level logic and workflow

Player classes

Card ClassGood job with the enum!What test cases do we needhere?

Let’s take another look: Class dependencyGameComputerPlayerUserPlayerCardCardPile

Player Base class:common fields andmethods for user andcomputer- Add a card to hand- Discard a card- Has flus, has four suit,has etc- Calculate rank- Calculate # of cards ucan discard- Get handCard Pile- Shuffle- Deal a cardCard- Number, suit, stringGame Session: mainlogic and workflow- Set up pile- Instantiate Players- Deal to Players- Players replace cards- Decide results andwinnersUser Player- Interactive selectionFive CardDraw (Main):UI and orchestration- Prompt # of players- Trigger dealing- User's turn- AI's turn- Display resultsComputer Player- AI functionAnd Cleaner class design

DiscussionsCreate Loosely coupled, self-contained classes Less dependent on other classCan perform its own domain of businessRespect other’s boundary. Don’t overreachSeparate UI vs. logic, and logic vs. data accessOne direction dependency.Layer: lower layer shouldn’t be aware of higher layer. High layer shouldn’t carehow lower layer does its jobWhy separate frontend and backend classes?Easier to debug, read, maintain, and scale.What could have been done differently? Player show hands: move display part out of Player class“Hand” class?

CardPile ClassWhat are we missing here?

CardPile testcontinuesHow do we test the drawncard should match themissing card from pile?How do we access privatemethods and fields ofCardPile?

BasePlayer TestTest “hasAce”: Both positive and negativecaseshow many times do we needto runSame for hasFourSuit,ResolveReplaceChances:need to test path hasAceand not haveAceHint: use @Before, @Afterto set up handsaddCard() hasAce() ResolveReplaceChances()

Different levels of testing UAT: real users System testing: QA Integration:Developers, maybeQA Unite testing:developers

More about testing System testing vs. functional testingRegression testingSmoke testingContinuous testingLoad/performance testingEdge case (what happen to GameSession if two players havesame hand rank? What if someone’s birthday is right at0:00AM? What if )

- Add a card to hand - Discard a card - Has flus, has four suit, has etc - Calculate rank - Calculate # of cards u can discard - Get hand And Cleaner class design Five CardDraw (Main): UI and orchestration - Prompt # of players - Trigger dealing - User's turn - AI's turn - Display result

Related Documents:

tres tipos principales de software: software de sistemas, software de aplicación y software de programación. 1.2 Tipos de software El software se clasifica en tres tipos: Software de sistema. Software de aplicación. Software de programación.

The IC Dedicated Support Software is described in Section 1.4.3.2. 1.3.1.2 Security Software The IC Dedicated Software provides Security Software that can be used by the Security IC Embedded Software. The Security Software is composed of Services Software and Crypto Library. The Services Software consists of Flash Services Software, Services .

SDD Software Design Document SDP Software Development Plan SEL Software Engineering Laboratory SIDD Software Interface Design Document SLOC Source Lines of Code SRS Software Requirement Specification WBS Work Breakdown Structure YİE Software Process Group in ASELSAN Inc. YMM

Use Model-Based Design to model the system design and software design, and to generate flight code Results Software testing time cut by two-thirds Requirements stabilized earlier Certified flight software automatically generated Eurocopter Accelerates Development of DO-178B Certified Software with Model-Based Design "We use our system design

Software Design Document 1 Introduction The Software Design Document is a document to provide documentation which will be used to aid in software development by providing the details for how the software should be built. Within the Software Design Document are narrative and graphical documentatio

Software Design 4.1 Introduction This section describes the software design for the flow meter application. The software design consists mainly of the flow calculation, database, user interface, and communication modules. This chapter aims to explain the software design. The software arc

Software Process Capability is the range of expected results that are achievable by following the software process. 1. Software Processand the Software Life Cycle October 2011 J Paul Gibson: Agile Methods Software process performance is the actual result achieved in the development of software by following a software process.

Korean language is an agglutinative language and is sometimes recognized tricky to learn by the people who speak a European language as their primary language. But depending on how systematical the education method is, it can be efficiently learned with the aid of its scientific letter system Hangeul. This book aims to provide the comprehensive rules and factors of the Korean language in a .