Docstoc

Introduction to BlueJ

Document Sample
Introduction to BlueJ Powered By Docstoc
					Introduction to BlueJ




      AP Computer Science 2012   1
                 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.
• an environment that is sophisticated, but at
  the same time easy to use
NO PSVM !!!!!

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

                    AP Computer Science 2012   3
BlueJ Environment


                                • Test Class
                                • Class
                                • Object




     AP Computer Science 2012                  4
                           • Behavior
                           • State
AP Computer Science 2012                5
              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            6
       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   7
        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   8
Test results




  AP Computer Science 2012   9
        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       10

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:4/9/2014
language:Unknown
pages:10