question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

binary-search-tree: extract initialization and rename test class

See original GitHub issue

In the binary-search-tree exercise, the test class is named BSTTest and the target class name is BST. For better or for worse, idiomatic Java avoids abbreviations. Also, each test method creates its own instance of BST. Unfortunately, Shalloway’s Law applies.

Please:

  1. Rename the test suite to a more descriptive name.
  2. Rename the target class to a congruent name (ideally, the name of the test suite is the name of the class with a Test suffix).
  3. Extract construction of the subject under test in setUp().

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
delbertleggcommented, Oct 9, 2017

RTFM aye! 😃 Thanks for the explanation. Working on the fix now.

1reaction
FridaTveitcommented, Mar 22, 2017

Yup, those are the correct files 😃 The convention for class names in java is to start with a capital letter, use camelCase and avoid abbreviations. So I would suggest BinarySearchTree.java and BinarySearchTreeTest.java 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit testing a binarysearchtree [closed] - Stack Overflow
Some binary tree class that only works with nodes. Lets name it BinaryTree . It supports insertion and removal of Node * ,...
Read more >
Binary Search Tree in R with R6 Reference Class - YouTube
Binary Search Tree in R with R6 Reference Class. Watch later. Share. Copy link. Info. Shopping. Tap to unmute.
Read more >
Java Program to Rename a File - GeeksforGeeks
Changing the name of the file is known as Renaming the file. Rename operation is possible using renameTo() method belongs to the File...
Read more >
Programming Assignment #5 (binary search tree iterator)
Your assignment is to complete these. New methods in class BSTWithIter. begin(). returns an iterator pointing to the first element of the BST...
Read more >
Python Binary Search Tree - Code Review Stack Exchange
As an exercise to get better in Python, I decided to implement a Binary Search Tree. This implementation uses two classes: BSTNode and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found