1 / 10

Introduction to BlueJ

Introduction to BlueJ. BlueJ WHY…what’s the motivation?. an environment that is object-oriented. an environment that emphasizes classes and objects as its basic units of interaction , so that students are naturally led into a way of thinking in terms of classes and objects.

dagmar
Download Presentation

Introduction to BlueJ

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. Introduction to BlueJ AP Computer Science 2012

  2. BlueJWHY…what’s the motivation? • an environment that is object-oriented. • an environment that emphasizes classes and objects as its basic units of interaction, so that students are naturally led into a way of thinking in terms of classes and objects. • an environment that is sophisticated, but at the same time easy to use NO PSVM !!!!! AP Computer Science 2012

  3. Coding: • Constructor • Objects and classes • State and behavior • Method signature and definition • Parameters • loops • int, String, boolean, void • TESTING AP Computer Science 2012

  4. BlueJ Environment • Test Class • Class • Object AP Computer Science 2012

  5. Behavior • State AP Computer Science 2012

  6. Test Class-JUnit • Automate individual testing of separate methods • Create test method for each method in class… • numDigits tested by testNumDigits • The test class method should run through all test cases. AP Computer Science 2012

  7. Testing for numDigits: @Test public void testNumDigits(){ assertEquals(1,one.numDigits()); assertEquals(2,two.numDigits()); assertEquals(3,three.numDigits()); assertEquals(4,four.numDigits()); assertEquals(5,five.numDigits()); } AP Computer Science 2012

  8. Testing for sumDigits: @Test public void testSumDigits(){ assertEquals(1,one.sumDigits()); assertEquals(3,two.sumDigits()); assertEquals(6,three.sumDigits()); assertEquals(10,four.sumDigits()); assertEquals(15,five.sumDigits()); } AP Computer Science 2012

  9. Test results AP Computer Science 2012

  10. Fun with FunNumber • Using Test Classes • And • Pair programming: • 15 minute segments: • Station 1 navigator becomes Station 1 Coder; Station 1 coder moves. AP Computer Science 2012

More Related