March 2015
Intermediate to advanced
236 pages
5h 26m
English
The order of data, or the position of one piece of data within a larger collection, represents a CORRECTness criterion where it’s easy for code to go wrong.
Let’s look at a need for ordering in the iloveyouboss application. One of the application’s core features is to score a list of companies based on how well they match criteria. Naturally, we always want to see the best match first, followed by the losers, biggest loser last.
The answersResultsInScoredOrder test represents the ordering need:
| iloveyouboss/15/test/iloveyouboss/ProfilePoolTest.java | |
| | @Test |
| | public void answersResultsInScoredOrder() { |
| | smeltInc.add(new Answer(doTheyReimburseTuition, Bool.FALSE)); |
| | pool.add(smeltInc); |
| | langrsoft.add(new Answer(doTheyReimburseTuition, ... |
Read now
Unlock full access