The Design Recipe in Java – Vocabulary Flashcards

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/19

flashcard set

Earn XP

Description and Tags

A set of key vocabulary terms and definitions drawn from the lecture on applying the six-step Design Recipe when writing Java methods.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

Design Recipe

A six-step, pre-coding framework that guides you from understanding a problem to implementing and testing the final Java code.

2
New cards

Step 0 – Understand and Restate the Problem

The phase where you clarify the required input, the expected output, and the task the code must accomplish before writing any code.

3
New cards

Input

The data a method or program receives to work with, e.g., a double representing a circle’s radius.

4
New cards

Output

The data a method or program returns after processing, e.g., a double representing a circle’s area.

5
New cards

Step 1 – Data Definitions

The step in which you specify the exact data types (primitive, object, collection, etc.) of inputs and outputs.

6
New cards

Primitive Type

A basic Java data type such as int, double, char, or boolean.

7
New cards

Step 2 – Method Signature

The Java header that names a method, lists its parameters, and states its return type.

8
New cards

Purpose Statement

A plain-English comment that explains what a method is supposed to do and what it returns.

9
New cards

Step 3 – Examples and Tests

Creating concrete input-output pairs (test cases) to predict and verify a method’s behavior, including normal and edge cases.

10
New cards

Edge Case

An atypical or extreme input (e.g., zero or negative values) used to test how robust a method is.

11
New cards

JUnit

A popular Java framework used to automate the execution of test cases created in Step 3.

12
New cards

Step 4 – Skeleton / Method Template

A high-level outline or pseudocode of a method’s logic written before the full implementation.

13
New cards

Pseudocode

Language-agnostic, structured comments or steps that describe what code will do without using full Java syntax.

14
New cards

Step 5 – Implementation, Testing, and Refinement

Writing the actual Java code, running tests, and polishing the solution according to results and best practices.

15
New cards

Best Practices

Agreed-upon coding conventions and techniques that improve readability, maintainability, and reliability of code.

16
New cards

computeArea(double radius)

Example method that returns Math.PI * radius * radius to compute the area of a circle.

17
New cards

toFahrenheit(double celsius)

Example method that converts Celsius to Fahrenheit using (celsius * 9 / 5) + 32.

18
New cards

Test Case

A specific scenario consisting of an input and its expected output, used to verify correct behavior of code.

19
New cards

Method Header

The first line of a Java method that includes access modifier, static keyword (optional), return type, name, and parameters.

20
New cards

Skeleton Code

An incomplete version of a program or method where major structural elements are present but detailed logic is not yet implemented.