Skip to Content
Hands-On Software Engineering with Python
book

Hands-On Software Engineering with Python

by Nimesh Verma, Brian Allbee
October 2018
Beginner to intermediate
736 pages
17h 39m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Python

Unit testing BaseDataObject

Unit testing of BaseDataObject is going to be… interesting, as it stands right now. Testing the matches method, a concrete method that depends on an abstract method (to_data_dict), which, in turn depends on the actual data structure (properties) of a derived class, is either not possible or meaningless in the context of the test case class for BaseDataObject itself:

  • In order to test matches, we have to define a non-abstract class with a concrete implementation of to_data_dict, and some actual properties to generate that resulting dict from/with
  • That derived class, unless it also happens to be an actual class needed in the system, has no relevance in the final system's code, so tests there do not assure us that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Software Architecture with Python

Software Architecture with Python

Anand Balachandran Pillai
Data Structures and Algorithms in Python

Data Structures and Algorithms in Python

Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser

Publisher Resources

ISBN: 9781788622011Supplemental Content