Infotest Java Infotest Java Package Assignment 1 Import Stat
Infotestjavainfotestjavapackageassignment1importstaticorgjunitass
Implement the class Info as a singly linked list with internal Node class, including methods for inserting, deleting, retrieving items, counting, copying, merging, and converting to string, adhering to specified behaviors and Java style standards. Create a class Item with String and int attributes. Use given JUnit tests to verify correct implementation, and modify or expand tests as needed. Submit your InfoTest.java, Info.java, and Item.java files by the specified deadline.
Paper For Above instruction
The assignment focuses on implementing a data structure class, named Info, designed as a singly linked list of comparable items, complemented by comprehensive unit testing. The core goal is to develop a robust, efficient, and style-compliant class that manages a collection of items in ascending order, using internal Node class structures and adhering strictly to Java programming standards. This task encompasses creating the Item class, developing the Info class with various methods, and ensuring their correctness through JUnit testing.
The Info class is a custom collection that maintains its data in a sorted manner. It leverages an internal Node class, where each Node holds an Item object, which includes two attributes—String and int. The Info class maintains a reference to the first Node (list) and the number of nodes (numNodes). Unlike Java's standard collection classes, this implementation eschews Java Collections Framework utilities for educational clarity and control, emphasizing core data structure concepts.
The Item class should be a simple data holder with appropriate constructors and methods such as compareTo and toString. The Info class must implement methods that allow inserting items in order, deleting existing items, retrieving items by position, finding the index of an item, copying a range of items into a new Info object, merging with another Info object without duplicates, and converting the list content into a string for display or testing purposes.
Unit tests, written with JUnit, cover all major functionalities including insertion, deletion, retrieval, counting, copying, merging, and searching. The tests not only verify correct outputs but also enforce robustness against edge cases like empty lists or out-of-bounds access. Modifications and improvements to the test suite are encouraged after initial implementation based on observed deficiencies or additional requirements.
In implementing these classes, it is crucial to follow Java best practices for style and documentation. Methods should include descriptive JavaDoc comments, variable names should be meaningful, and code should be organized logically to ensure clarity and maintainability. The design emphasizes understanding of linked lists, object comparison, and proper use of internal classes and encapsulation.
Furthermore, students must submit all relevant source files—InfoTest.java, Info.java, and Item.java—by the specified deadline via Blackboard. The submission is assessed based on correctness, code quality, adherence to specifications, and the quality of unit tests. Late submissions incur penalties, underscoring the importance of timely and precise work. This assignment provides practical experience in working with linked data structures, developing comprehensive test suites, and producing clean, documented code worthy of academic and professional standards.
References
- Effective Java, Joshua Bloch, Addison-Wesley, 2018.
- Data Structures and Algorithms in Java, Robert Lafore, Pearson, 2002.
- JUnit 5 User Guide, JUnit Team, 2021.
- Clean Code: A Handbook of Agile Software Craftsmanship, Robert C. Martin, Prentice Hall, 2008.
- Java: The Complete Reference, Herbert Schildt, McGraw-Hill, 2019.
- Introduction to Algorithms, Cormen et al., MIT Press, 2009.
- Object-Oriented Software Engineering, P. Kruchten, McGraw-Hill, 1995.
- Effective test-driven development, Kent Beck, Addison-Wesley, 2003.
- The Art of Unit Testing, Roy Osherove, Manning Publications, 2013.
- Java Programming Style and Recommendations, Oracle Documentation, 2020.