Code Base Understanding
Code Base Understanding
Students will navigate a complex Java code base using a number of different techniques or strategies to understand the design and architecture.
CS 2 - Data structures in Java
|After successfully completing this activity, the learner should be able to:
| Process Skills
Is there background reading material?
- Josh will add*
Are there other activities the student should have done first?
- Read technical documentation specific to the project (project installation, tools needed, APIs) - assumption is that the environment is already installed
- Run the program, understand the behavior of it
Come up with an enhancement - provides the motivation for this activity
What is the rationale for this activity?
- Students cannot become contributors to HFOSS projects until they understand the code base. This activity provides a number of strategies to help students approach a new code base and make sense of it. It has starting points (such as looking at unit testing) and more advanced techniques (such as using visualization tools to understand dependencies).
Include helpful hints to faculty here. Visualization tools for Java:
- Code City: https://marketplace.eclipse.org/content/codecity
- X-Ray: https://marketplace.eclipse.org/content/x-ray-software-visualization
- JDeodorant: https://marketplace.eclipse.org/content/jdeodorant
This activity is designed for Eclipse. Suggestion: have students work in groups
- Look for unit tests, data model, high level classes, find something familiar, look at imports - are there packages the code is dependent upon?
- Run unit tests
- Look for superclasses
- From package dependencies figure out classes and package structure
Ordering where to look:
- Find any technical documentation (like JavaDoc) - keep it open to refer back to
- Look for a folder called testing and look for unit tests - if none exists then search junit in imports
- What are the methods that are tested (hopefully there is documentation)? This identifies the core clases - these are classes of high interest
- Run the unit tests
- Find the high level classes in the data model and the interfaces (in a game, the sprites, weapons, actors, etc. put another example here)
- Use CodeCity and then X-Ray to visualize the code - what is most of the code dependent upon? Students should look at the code at the same time as they explore the visualization. This will help understand the class dependencies. (Ruby can expand on the criteria that can be used to visualize)
- Look at the import list to see if it is dependent upon other libraries
- Find the data model, how is the data saved, what data structures are used?
- JDeodorant could be used to help understand potential refactoring because it looks at bad part of the code
Submit answers to questions and screen captures Give instances of each of the bad smells from JDeodorant Ultimate Goal: Make a code contribution back to the project with the enhancement.
- How will the activity be graded?
- How will learning will be measured?
- Include sample assessment questions/rubrics.
|Criteria||Level 1 (fail)||Level 2 (pass)||Level 3 (good)||Level 4 (exceptional)|
|The purpose of the project|
|Why the project is open source|
- What should the instructor know before using this activity?
- What are some likely difficulties that an instructor may encounter using this activity?
Potential problems in this activity may be if the underlying code base changes and/or that the student may not find what they are looking for (e.g., the project may not contain unit tests, etc.).
| ACM BoK
Area & Unit(s)
| ACM BoK
| Estimated Time
| Environment /
Ruby ElKharboutly, Josh Dehlinger, Ed Gehringer, Moshen Doroodchi, Lori Postner
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
Suggestions for Open Source Community
Suggestions for an open source community member who is working in conjunction with the instructor.