SlideShare a Scribd company logo
1 of 14
Chapter 12. Getting
Ready to Bid
Yenifer Barco Castrllón
An introduction to the Market
• Single item: join, bid,
and lose. When a price
comes in, send a bid
raisedby the minimum
increment defined by
the auction. This
amount will be
included in the price
update information.
• Single item: join, bid,
and win. Distinguish
which bidder is
currently winning the
auction and don’t bid
against ourselves.
A Test for Bidding
Starting with a Test
So we decide that the next
one will add some price
information. The steps are:
1. Tell the auction to send a
price to the Sniper.
2. Check the Sniper has
received and responded to the
price.
3. Check the auction has
received an incremented bid
from Sniper.
Extending the Fake
Auction
We have two methods to
write in the FakeAuctionServer
to support the end to-end
test:
• reportPrice() has to send a
Price message through the
chat.
• hasReceivedBid() is a little
more complex—it has to
check that the auction
received the right values from
the Sniper.
Outside-In Development
Test-driven development is
to start with the outside
event that triggers the
behavior we want to
implement and work our
way into the code an object
at a time, until we reach a
visible effect (such as a sent
message or log entry)
indicating that we’ve
achieved our goal.
Infinite Attention to Detail?
How can we hope to
catch all the
configuration options
in an entire system?
At some level we can’t,
and this is at the heart of
what professional testers
do.
What we can do is push
to exercise as much as
possible of the system as
early as possible, and to
do so repeatedly
The AuctionMessageTranslator
Teasing Out
a New Class
Our entry point to the
Sniper is where we receive
a message from the
auctionthrough the Smack
library: it’s the event that
triggers the next round of
behavior we want to make
work.
In practice, this means that
we need a class
implementing
MessageListener to attach
to the Chat.
When this class receives a raw message from the auction, it
will translate it into something that represents an auction event
within our code which, eventually, will prompt a Sniper action
and a change in the user interface.
Closing the
User
Interface
Loop
Previously, Main updated
the Sniper user interface,
so now we make it
implement
AuctionEventListener and
move the functionality to
the new auctionClosed()
method.
Finish the Job
We write a high-
level end-to-end test
to describe what the
Sniper should
implement.
1
we write long unit
test names to tell us
what a class does.
2
we extract new
classes to tease
apart fine-grained
aspects of the
functionality.
3
we write lots of little
methods to keep
each layer of code at
a consistent level of
abstraction.
4
Gettin ready to bid

More Related Content

Similar to Gettin ready to bid

Calculator 2
Calculator 2Calculator 2
Calculator 2
livecode
 
Auction its implementation and software agents
Auction its implementation and software agentsAuction its implementation and software agents
Auction its implementation and software agents
HimaniChauhan
 
Applications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docxApplications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docx
ssusera34210
 
Applications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docxApplications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docx
festockton
 
Algorithm types performance steps working
Algorithm types performance steps workingAlgorithm types performance steps working
Algorithm types performance steps working
Saurabh846965
 

Similar to Gettin ready to bid (20)

6. Compile And Run
6. Compile And Run6. Compile And Run
6. Compile And Run
 
Getting started with Ritc - Example 1
Getting started with Ritc - Example 1Getting started with Ritc - Example 1
Getting started with Ritc - Example 1
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Trading: How to attain maximum advantage while trading?
Trading: How to attain maximum advantage while trading?Trading: How to attain maximum advantage while trading?
Trading: How to attain maximum advantage while trading?
 
Refactoring legacy code driven by tests - ITA
Refactoring legacy code driven by tests -  ITARefactoring legacy code driven by tests -  ITA
Refactoring legacy code driven by tests - ITA
 
Building a blockchain part 3
Building a blockchain part 3Building a blockchain part 3
Building a blockchain part 3
 
Calculator 2
Calculator 2Calculator 2
Calculator 2
 
Auction its implementation and software agents
Auction its implementation and software agentsAuction its implementation and software agents
Auction its implementation and software agents
 
Applications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docxApplications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docx
 
Applications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docxApplications of Rationalizability and Iterated DominanceEcon 4.docx
Applications of Rationalizability and Iterated DominanceEcon 4.docx
 
While.doc
While.docWhile.doc
While.doc
 
While R&D WITH ORACLE SOA
While R&D WITH ORACLE SOAWhile R&D WITH ORACLE SOA
While R&D WITH ORACLE SOA
 
Bitcoin Price Prediction
Bitcoin Price PredictionBitcoin Price Prediction
Bitcoin Price Prediction
 
Algorithm types performance steps working
Algorithm types performance steps workingAlgorithm types performance steps working
Algorithm types performance steps working
 
Advanced Computer Programming..pptx
Advanced Computer Programming..pptxAdvanced Computer Programming..pptx
Advanced Computer Programming..pptx
 
OLT open script
OLT open script OLT open script
OLT open script
 
Acceptance Test-driven Development: Mastering Agile Testing
Acceptance Test-driven Development: Mastering Agile TestingAcceptance Test-driven Development: Mastering Agile Testing
Acceptance Test-driven Development: Mastering Agile Testing
 
Дмитрий Копляров , Потокобезопасные сигналы в C++
Дмитрий Копляров , Потокобезопасные сигналы в C++Дмитрий Копляров , Потокобезопасные сигналы в C++
Дмитрий Копляров , Потокобезопасные сигналы в C++
 
TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
 
Agile Estimating And Planning
Agile Estimating And PlanningAgile Estimating And Planning
Agile Estimating And Planning
 

More from Yenifer Castrillon (11)

Entrega final check on
Entrega final  check onEntrega final  check on
Entrega final check on
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Pre entrega check - on
Pre entrega check - onPre entrega check - on
Pre entrega check - on
 
Check-on
Check-onCheck-on
Check-on
 
Check - on
Check - onCheck - on
Check - on
 
Presentation
PresentationPresentation
Presentation
 
Tecno app
Tecno appTecno app
Tecno app
 
Java 8 collections
Java 8  collectionsJava 8  collections
Java 8 collections
 
Observer design pattern
Observer design patternObserver design pattern
Observer design pattern
 
Observer design pattern
Observer design patternObserver design pattern
Observer design pattern
 

Recently uploaded

Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
drm1699
 

Recently uploaded (20)

Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfThe Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
 
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
 
The Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test AutomationThe Strategic Impact of Buying vs Building in Test Automation
The Strategic Impact of Buying vs Building in Test Automation
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
 
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
Wired_2.0_CREATE YOUR ULTIMATE LEARNING ENVIRONMENT_JCON_16052024
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AI
 

Gettin ready to bid

  • 1. Chapter 12. Getting Ready to Bid Yenifer Barco Castrllón
  • 2. An introduction to the Market
  • 3. • Single item: join, bid, and lose. When a price comes in, send a bid raisedby the minimum increment defined by the auction. This amount will be included in the price update information. • Single item: join, bid, and win. Distinguish which bidder is currently winning the auction and don’t bid against ourselves.
  • 4. A Test for Bidding
  • 5. Starting with a Test So we decide that the next one will add some price information. The steps are: 1. Tell the auction to send a price to the Sniper. 2. Check the Sniper has received and responded to the price. 3. Check the auction has received an incremented bid from Sniper.
  • 6. Extending the Fake Auction We have two methods to write in the FakeAuctionServer to support the end to-end test: • reportPrice() has to send a Price message through the chat. • hasReceivedBid() is a little more complex—it has to check that the auction received the right values from the Sniper.
  • 7. Outside-In Development Test-driven development is to start with the outside event that triggers the behavior we want to implement and work our way into the code an object at a time, until we reach a visible effect (such as a sent message or log entry) indicating that we’ve achieved our goal.
  • 8. Infinite Attention to Detail? How can we hope to catch all the configuration options in an entire system? At some level we can’t, and this is at the heart of what professional testers do. What we can do is push to exercise as much as possible of the system as early as possible, and to do so repeatedly
  • 10. Teasing Out a New Class Our entry point to the Sniper is where we receive a message from the auctionthrough the Smack library: it’s the event that triggers the next round of behavior we want to make work. In practice, this means that we need a class implementing MessageListener to attach to the Chat. When this class receives a raw message from the auction, it will translate it into something that represents an auction event within our code which, eventually, will prompt a Sniper action and a change in the user interface.
  • 11. Closing the User Interface Loop Previously, Main updated the Sniper user interface, so now we make it implement AuctionEventListener and move the functionality to the new auctionClosed() method.
  • 13. We write a high- level end-to-end test to describe what the Sniper should implement. 1 we write long unit test names to tell us what a class does. 2 we extract new classes to tease apart fine-grained aspects of the functionality. 3 we write lots of little methods to keep each layer of code at a consistent level of abstraction. 4

Editor's Notes

  1. Each acceptance test we write should have just enough new requirements to force a manageable increase in functionality
  2. We also pull up the Matcher clause from the SingleMessageListener to give the FakeAuctionServer more flexibility in defining what it will accept as a message.
  3. We can also help ourselves cope with total system complexity by keeping the quality of its components high and by constantly pushing to simplify.
  4. We can also help ourselves cope with total system complexity by keeping the quality of its components high and by constantly pushing to simplify.
  5. When this class receives a raw message from the auction, it will translate it into something that represents an auction event within our code which, eventually, will prompt a Sniper action and a change in the user interface.