Test Abstractions Intent Nat. Lang. Spec. HW Behavioral Tests can be described at different abstraction levels Tests can be defined top-down or bottom-up.

Slides:



Advertisements
Similar presentations
By: Jonathan Quenzer. To have a computer learn how to play Blackjack through reinforcement learning Computer starts off with no memory. After each hand.
Advertisements

Driving Rules: Signs and Symbols 1.Identify sign or symbol on the road 2.Explain what it means.
Phase 2 -- Logic Implementation & Simulation Switching & Logic Design Project.
Simulation executable (simv)
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Counters. In class excercise How to implement a “counter”, which will count as 0,3,1,4,5,7,0,3,1,…… Q2Q1Q0D2D1D
Structured Design. 2 Design Quality – Simplicity “There are two ways of constructing a software design: One is to make it so simple that there are obviously.
Practice Quiz Question
Lecture 10. Simplified roulette European roulette has numbers 0,1,…36. xD0s
1. (-5) + 5 = ______ (-9) = ______ 3.Justify your answer using the number line above. 4.On the number line above, place the number 7 and it’s opposite.
Chapter 10 Algorithmic Thinking. Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Learning Objectives List the five essential.
BLACKJACK SHARKS: Aabida Mayet, Omar Bacerra, Eser Kaptan March 15, 2010.
An application of the Probability Theory
Rene Plowden Joseph Libby. Improving the profit margin by optimizing the win ratio through the use of various strategies and algorithmic computations.
Computer Science 313 – Advanced Programming Topics.
Design Example. Requirements Make a program that simulates the game of blackjack For now, we ignore money/betting…. just simulate game play But… this.
VLSI Systems--Spring 2009 Introduction: --syllabus; goals --schedule --project --student survey, group formation.
1 COMP541 Sequencing and Control Montek Singh Mar 29, 2007.
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design 8.5 Finite State Machine.
HAS. Patterns The use of patterns is essentially the reuse of well established good ideas. A pattern is a named well understood good solution to a common.
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
Chapter 5 Black Jack. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. 5-2 Chapter Objectives Provide a case study example from problem statement.
Principle of Functional Verification Chapter 1~3 Presenter : Fu-Ching Yang.
Overview Part 1 – Design Procedure 3-1 Design Procedure
Black Jack Dr. Bernard Chen University of Central Arkansas Spring 2012.
CORE MECHANICS. WHAT ARE CORE MECHANICS? Core mechanics are the heart of a game; they generate the gameplay and implement the rules. Formal definition:
Blackjack: Myths vs. Reality Group K Andrew KerrAndrew Phillips Sven SkoogWoj Wrona.
Permutations and Combinations
Software Integration and Documenting
Blackjack: An Analysis of Probability By: John Theobald.
April 2009 BEATING BLACKJACK CARD COUNTING FEASIBILITY ANALYSIS THROUGH SIMULATION.
Software Testing. Definition To test a program is to try to make it fail.
Brian Duddy.  Two players, X and Y, are playing a card game- goal is to find optimal strategy for X  X has red ace (A), black ace (A), and red two (2)
Casinos There’s a reason they are big and extravagant!
1 Introduction to Discrete Probability Rosen, Section 6.1 Based on slides by Aaron Bloomfield and …
Learning to Play Blackjack Thomas Boyett Presentation for CAP 4630 Teacher: Dr. Eggen.
Inner and Anonymous Classes Though you are captive in the OO paradigm, you can use inner classes and anonymous classes to get around this constraint and.
Intro to Architecture – Page 1 of 22CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: Introduction Reading: Chapter 1.
Michael Drake MMP Day 2008 Teaching algebra for meaning.
Combinational Logic Design BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Blackjack: A Beatable Game Amber Guo Adapted from: David Parker Advisor: Dr. Wyels California Lutheran University ‘05.
Exceptions: Checked versus Unchecked Exceptions.
Blackjack Betting and Playing Strategies: A Statistical Comparison By Jared Luffman MSIM /3/2007.
Main Program Repeat call InitialiseVar # a procedure to reset all variables call ShufflePack# a procedure to generate a random list of 52 cards call PlayerGo#
Oklahoma’s Personal Financial Literacy Passport © Oklahoma State Department of Education. All rights reserved. 1 Teacher Presentation Series 12 Standard.
Oklahoma’s Personal Financial Literacy Passport © Oklahoma State Department of Education. All rights reserved. 1 Teacher Presentation Series 12 Standard.
Functional Verification Figure 1.1 p 6 Detection of errors in the design Before fab for design errors, after fab for physical errors.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics Basics of register-transfer design: –data paths and controllers; –ASM charts. Pipelining.
1 by: Ilya Melamed Supervised by: Eyal Sarfati High Speed Digital Systems Lab.
ICS 216 Embedded Systems Validation and Test Instructor: Professor Ian G. Harris Department of Computer Science University of California Irvine.
Neural Network Implementation of Poker AI
Gambling Because why not?. Blackjack and card counting Card counting is a casino card game strategy used primarily in the blackjack family of casino games.
Lecture 12. Game theory So far we discussed: roulette and blackjack Roulette: – Outcomes completely independent and random – Very little strategy (even.
WOULD YOU PLAY THIS GAME? Roll a dice, and win $1000 dollars if you roll a 6.
The Anatomy of a Computer Program Unit 3. Programs are Directions  A computer carries out the instructions in a program, line by line, exactly as they.
GamblingGambling What are the odds? Jessica Judd.
Introduction to ASIC flow and Verilog HDL
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
Digital Logic Design Lecture # 6 University of Tehran.
Computer Organization and Design Transistors & Logic - I Montek Singh Mon, Feb 28, 2011 Lecture 8.
The Pentium Goes to Vegas Training a Neural Network to Play BlackJack Paul Ruvolo and Christine Spritke.
Chapter 1 The Phases of Software Development. Software Development Phases ● Specification of the task ● Design of a solution ● Implementation of solution.
© Oklahoma State Department of Education. All rights reserved.1 The Costs and Benefits of Gambling Gambling.
Discrete Optimization MA2827 Fondements de l’optimisation discrète Dynamic programming (Part 2) Material based on.
Lecture 11.
Lecture 10.
Probability of casino games
Lecture 12.
Blackjack: Counting Hands and Counting Cards
CS 153 Logic Design Lab Professor Ian G. Harris
Presentation transcript:

Test Abstractions Intent Nat. Lang. Spec. HW Behavioral Tests can be described at different abstraction levels Tests can be defined top-down or bottom-up Example: A Blackjack Machine Check if the computer obeys the dealer rules when it has 17 or more points Player: Immediately stands. Dealer should stand when dscore is >= 17 pStand <= 0; (dHit) if (dscore > 17) $display(“error”);

Black Box Testing Testing without knowledge of the internals of the design. Only know system inputs/outputs Testing the functionality without considering implementation Inherently top-down 1.Test a multiplier by supplying random numbers to multiply 2.Test an anti-lock braking system by hitting the brakes at different speeds 3.Test a traffic light controller by simulating pre-recorded traffic patterns Black Box Testing Examples:

Black Box Testing Issues Advantages: Tests can be generated early in the design process Tests can often be reused after design change Disadvantages: Less information is available for test generation More manual process because no simulatable info exists Example: Random test generation

Specification-Based Test A block box testing approach Natural language specification is used to generate test sequence Goal is to generate tests which verify all aspects of the specification Extract a featureCreate nat. lang testsCreate executable tests Until all features have tests Clear relationship between features and tests Good to accommodate specification change

Extracting Features from a Specification Purely manual process Specs are long and vague The dealer must continue to take cards ("hit") until his total is 17 or greater. An Ace in the dealer's hand is always counted as 11 if possible without the dealer going over 21. Part of a Blackjack Specification Each sentence could be a feature for testing

A Feature from Blackjack A blackjack, or natural, is a total of 21 in your first two cards. If you split a pair of Aces for example, and then draw a ten-valued card on one of the Aces, this is not a blackjack, but rather a total of 21. The distinction is important, because a winning blackjack pays the player odds of 3 to 2. This detail is exactly something that a designer might miss Maybe the designer doesn’t appreciate the difference (3 to 2 odds)

Another Feature from Blackjack If the dealer turns an up-card of an Ace, he will offer "Insurance" to the players. Insurance bets can be made by betting up to half your original bet amount. The dealer will check to see if he has a 10-value card underneath his Ace, and if he does have Blackjack, your winning Insurance bet will be paid at odds of 2:1. Do you know what an “up-card” is? Is it clear that a player making an insurance bet ends up breaking even if the dealer has blackjack? Gamblers understand this, designers may not. Specifications often assume the background of the reader

Natural Language Test Descriptions  For each feature, describe tests to validate each feature Requirements of a Test Description 1.Describe sequence at controllable points Variables/signals which can be controlled during testing (inputs or internal) 2.Describe sequence at observable points Variables/signals where results are known (outputs or internal) 3.Describe timing if relevant to the application

Controllable and Observable Points Need to select variable/signals to apply test data and to observe test results Need minimal structural detail (I/O, etc.) Controllable points - Inputs are the obvious choice Other points are chosen to reduce test time or control randomness  Setting an internal 8 bit counter value  Bypassing a random process Observable points - Output are the obvious points Other points are chosen to reduce test time and localize errors  Observe internal regs in a microprocessor

Sample Test Description The dealer must continue to take cards ("hit") until his total is 17 or greater. The player’s choices should not matter Will any test validate this feature? No. - dealer has 16 and draws a 6 Need to control the “random” deal Possible test sequence: Player stands, dealer receives 10 and 7.

Sample Test Description Possible test sequence: Player bets X dollars. Player hits and draws an ace. Player hits and draws a 10. Verify 3 to 2 payoff. A blackjack, or natural, is a total of 21 in your first two cards. If you split a pair of Aces for example, and then draw a ten-valued card on one of the Aces, this is not a blackjack, but rather a total of 21. The distinction is important, because a winning blackjack pays the player odds of 3 to 2. Test this by causing the player to make a bet, draw a blackjack, and check the winnings

Create Executable Tests Write the verilog test bench to implement each test Need to know all controllable and observable points in detail Test sequence: Player stands, dealer receives 10 and 7. module BlackJack (player_choice, dealt_card, dealer_choice, …) player_choice = 1; // stand If (dealer_choice != 0) $display (“error”); #1 dealt_card = 10; If (dealer_choice != 0) $display(“error”); #1 dealt_card = 7; If (dealer_choice != 1) $display (“error”);