1 / 19

Academic Bug Patterns

Academic Bug Patterns. Stuart Hansen University of Wisconsin - Parkside. Bug Patterns. Recurring software defects Term coined by Eric Allen Bug Patterns in Java , APress, 2002 Academic Bug Patterns Occur in student code Not only “gotchas”. Motivation.

teagan-moss
Download Presentation

Academic Bug Patterns

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Academic Bug Patterns Stuart Hansen University of Wisconsin - Parkside

  2. Bug Patterns • Recurring software defects • Term coined by Eric Allen Bug Patterns in Java, APress, 2002 • Academic Bug Patterns • Occur in student code • Not only “gotchas”

  3. Motivation • Understanding our students’ bugs helps us teach them to • Find and remove them • Avoid them • Places empirical data behind our expertise • May give added insights

  4. Object-Oriented Programming • New Programming Paradigm → New bug Patterns • Does OOP Really Match the Way we Think?, Les Hatton, IEEE Software 1998 • OOP programs are buggier and take longer to debug than procedural programs.

  5. We are Experts Already • To a large extent we are already experts in academic bug patterns • CS1 and CS2 “gotchas” • Using symbolic constants • Problem decomposition • Textbooks include headings like • Common Programming Errors • Helpful Reminders

  6. Survey • Two Classes • Data Structures and Algoritms • Event Driven Programming • Two Questions: • What was the most difficult bug/problem you encountered doing the assignment? • What did you do to resolve it?

  7. Survey - continued • Intentionally wide open • Didn’t want to impose a taxonomy • Total of 56 surveys collected on 6 different assignments

  8. Results • 19 Language and Tools Bugs • 13 Strong Coupling Bugs • 11 Local/Instance Bugs • 6 Blame the Instructor Bugs

  9. Languages and Tools Pattern • 19/56 = 34% of all bugs reported • Lots of new stuff still being introduced • Swing • Microsoft .Net Programming • CORBA/RMI • Biggest student desire seems to be for brief cogent examples

  10. Languages and Tools Sol’ns • Search the Internet • Ask someone in class • Only 1 student reported reading the text to find the solution!

  11. Strong Coupling Bugs • 13/56 = 23% of all bugs reported • Event Driven Programming starts with lots of GUI material. • Model-View-Controller • Multi-threading • “When I came up one solution to a problem, it often caused new problems in other areas.”

  12. Strong Coupling - Continued • Students wrote long paragraphs describing how they solved their problems. • No discernable patterns to their approaches. • We probably don’t teach enough design patterns early in our curriculum.

  13. Local State/Object State Bug • 11/56 = 20% of all bugs reported • Students didn’t see whether data should be local, instance or belong to some sort of global data store. • Particularly true in game programming • Boggle and Connect 4 • Students have been introduced to recursion, but haven’t applied it much on their own.

  14. Local/Object – Continued • Basic truth not in texts is that M-V-C requires redundant state! • “When I clicked the Undo button, the screen would clear the last move, but inside the memory the program did not actually clear the data.”

  15. Brief Aside: • O-OP is gradually making its way into D.S. and Alg. courses. • Many texts still have Pascal look and feel. • Tension between O-OP and D.S. and Alg. • RedBlack trees require non-global, but more than local knowledge. • Null design pattern works, but an “if” may be clearer

  16. Polymorphism Bugs • 8/56 = 14% of all bugs reported • Java GUIs are fundamentally polymorphic • Use inheritance to build interfaces • Register handlers • Also in D.S. and Algs. • 2D Trees, e.g. BSTs based on (X,Y) points. • Registration is easier polymorphism related pattern than others

  17. Blame the Instructor - Bugs • 6/56 = 11% of all bugs reported • Anonymous survey is good opportunity to let loose on instructor • Two main complaints • Instructor code sometimes buggy • Program specs sometimes not clear enough

  18. Summary • “See one, do one” is dominant learning model for our students. • Languages, tools and libraries are growing more and more complex. • Object-oriented design still poses major challenges.

  19. Questions?

More Related