Skip to main content

Unit Testing

  • Chapter
  • First Online:
  • 1992 Accesses

Abstract

In this chapter we discuss a very important topic, unit testing our code. Proper unit testing coverage of our bot will ensure that we do not create many regressions when we make changes or add enhancements to the existing code. For some of the target audience of this book, the trading bot may be deployed to place real orders with a live account where huge sums of money could be involved. Making sure that we have enough test coverage will ensure that a code bug would be unlikely to place bad orders. We briefly summarize the immense benefits of unit testing here. Proper unit tests:

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    http://mockito.org/

  2. 2.

    http://docs.mockito.googlecode.com/hg/1.9.5/org/mockito/Spy.html

  3. 3.

    http://eclemma.org/

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Shekhar Varshney

About this chapter

Cite this chapter

Varshney, S. (2016). Unit Testing. In: Building Trading Bots Using Java. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2520-2_13

Download citation

Publish with us

Policies and ethics