Creating an Inventory of Java Fundamentals
What Will I Learn? Objectives List and define Java Programming terminology Recognize and label Java programming constructs Identify incorrect Java programming syntax List programming tasks to design and implement a game using Java List five variations to include in programming Q/A tests 2
Why Learn It? Purpose Think about the first time you played a video game. You had to learn how to use the controller and what moves to make to participate in the game. Once you learned those concepts, you could then apply that knowledge to additional games or use that knowledge as a base for learning more games. This lesson reinforces what you know up to this point and prepares you to build upon that knowledge. 3
Programming Concepts and Terms A computer program is: A sequence of instructions Tells a computer what to do Learning to program is: Thinking about and capturing a sequence of instructions Breaking down a problem into smaller tasks Writing comments to inform other programmers 4
Alice 3 Concepts and Terms In Alice 3: Animation of 3D objects take place in a virtual world Galleries contain 3D objects that move in 6 directions An Object has an orientation A scenario describes an overall animation A storyboard can be visual or textual A program consists of lines of code Program code is structured in blocks (Do together) Functions provide properties of an object Functions can be used to compute a value Boolean functions return true or false 5
Alice 3 Concepts and Terms In Alice 3: Conditional control structures: Use relational operators to compare boolean expressions Are used to make a decision Repetition control structures: Repeat a section of code based on a true boolean expression Are referred to as loops 6
Greenfoot Concepts and Terms In Greenfoot: Scenarios consist of a set of classes Objects are created from a class Objects placed in a world are known as actors Objects have methods Method return types specify what a method will return Void return types return nothing Parameters are used to pass data to a method Parameters have types (int, boolean) Signatures are a specification of a method A subclass is a specialization of a class Every class is defined by source code 7
Greenfoot Concepts and Terms In Greenfoot: Source code must be compiled Dot notation is used to call a static method in another class Methods belonging to classes use the static keyword in their signature Methods can be defined for a new action New methods are called after they are defined Comments are ignored by the computer Constructors are a special kind of method Fields (instance variables) are used to store information The double equal symbol = = is used to test equality if/else execution is based on a given condition 8
Java Programming Terms Programming Terms: Algorithm Argument Boolean value Bug Comment Condition Conditional execution Control structure Count Decision Design Event Expression Function If/Else instruction Implement Instruction Loop Method Nesting Property Pseudocode Relational operator Repetition Runtime Scenario Storyboard Syntax Test 9
Recognize Java Program Constructs Name the constructs in this Alice 3 example. 1 2 3 10
Recognize Java Program Constructs Name the constructs in this Greenfoot example. 1 2 3 11
Recognize Java Program Constructs Name the constructs in this Java code. 1 2 3 12
Recognizing Java Syntax Errors Keys to recognizing Java program syntax errors: Learn the parts of a method signature. Recognize when symbols such as quotes and semicolons are missing. For every opening parenthesis there must be a closing parenthesis. For every opening curly brace there must be a closing curly brace. Inspect capitalization and spelling of variables. Look again! 13
Tasks for Designing a Game Create a game to solve a problem. The game could have a simple concept, such as being the first player to journey through a path of obstacles successfully. Problem Solving Process Step 1: Define the Problem Step 2: Design and Develop a Solution Step 3: Program and Implement the Solution Step 4: Run, Test and Revise the Solution 14
Define the Problem Game Element Scenario Scene Objects in the Scene Player's Actions Description Be the first player to reach the end of the trail cluttered by obstacles. Pathway with obstacle images impeding the path. Pathway, fallen trees, rock slides, flowing rivers, herd of buffalo, snow slides, stuck trucks Travel along pathway Reach an obstacle Select tool from bag to resolve the obstacle Resolve the obstacle Put tool back into bag and continue on path 15
Add Interesting Features As you define the game, think about the details that will make the challenge interesting: Multiple scenes, actions and objects Interactivity controlled by keyboard or mouse Tracking scores 16
Design and Develop Design the: Scenario Actors Obstacles Methods Conditions Repetitions Score keeping Keyboard interactions Develop the: Solution Sample data Messaging Documentation 17
Use a Project Plan to Track Progress Project Plan Component Define the Problem Design the Game Additional Details Scenario, actors, obstacles Methods, conditions, repetitions Score-keeping, keyboard interaction Develop and Implement the Game Execute the program Perform Quality Assurance Testing and Revisions Present the Problem and Solution Scenario, actors, obstacles Methods and variables for score keeping Quality Assurance Testing can be defined as a systematic process of checking to see whether a product being developed is meeting specified requirements. 18
Project Plan Components Project plans should include: Task list Task duration (start and end dates) Task resources Task dependencies Task Start End Resource Dependency Design Actors 15-Nov-2011 30-Dec-2011 Caron Scenario design 19
Quality Assurance (Q/A) Stages Software testing activities or stages include: Requirement analysis Test planning Test case development Environment setup Test execution Test cycle closure 20
Quality Assurance Tasks Quality assurance tasks in each stage: Software Testing Stage Requirements Analysis Tasks Listing the type of tests to perform Prioritizing and focusing tests Automation feasibility Test Planning Test Case Development Writing test plan strategy Selecting test tools Estimating time required for testing Training Creating tests Identifying test data and baseline data Requirement analysis defined as a process for determining user expectations. Test case can be defined as a set of conditions or variables with which a test engineer will determine if a software program is working correctly. 21
Quality Assurance Tasks Quality assurance tasks in each stage: Software Testing Stage Environment Setup Tasks Set up hardware and software environment Test Execution Test Cycle Closure Execute test plans Document results Retest fixes Qualitative and quantitative customer reporting Test execution is defined as the execution of the same test against many parts of a software program (interface, business logic, web layer, etc.) A test cycle is a set of defined start and stop points in a quality assurance program. 22
Examples of Software Testing Variations Software Testing Variations Change the environment Tasks Change the operating system Change the browser Change the display settings Change the fonts Change the execution Change the keystrokes used Change the capitalization used Start, stop, and pause the execution Change the data Input numbers when characters are expected Input characters when numbers are expected Input symbols and varying amounts of data input 23
Terminology Key terms used in this lesson: Quality Assurance Testing Requirements Analysis Test case Test execution Test cycle 24
Summary In this lesson, you learned how to: List and define Java Programming terminology Recognize and label Java programming constructs Identify incorrect Java programming syntax List programming tasks to design and implement a game using Java List five variations to include in programming Q/A tests 25
Practice The exercises for this lesson cover the following topics: Matching Java Programming terms to a definition Recognizing Java programming constructs Identifying incorrect syntax Writing a project plan for designing a game Writing a Q/A test plan 26