29
Computational Thinking: Solving Problems Pertemuan 9 Sisilia Thya Safitri, MT Citra Wiguna, M.Kom

Computational Thinking: Solving Problemssisil.dosen.ittelkom-pwt.ac.id/wp-content/uploads/...•Analisis •Desain •Implementasi •Tahap analisis menjadi sangat penting karena merupakan

Embed Size (px)

Citation preview

Computational Thinking:Solving Problems

Pertemuan 9

Sisilia Thya Safitri, MT

Citra Wiguna, M.Kom

Objectives

• Problem Definition

• Logical Reasoning

• Decomposition : Software Design

• Decomposition : Other Uses

• Abstraction : Class Diagrams

• Abstraction : Use Case Diagram

Outline

• Like the scientific investigation process begins with a hypothesis, software development begins with a careful problem definition.

• Problem definition tugas yang akan diselesaikan oleh perangkat lunak

• 3 fase utama dalam pengembangan perangkat lunak:• Analisis

• Desain

• Implementasi

• Tahap analisis menjadi sangat penting karena merupakan tahapanpendefinisian masalah

• In fact a problem definition is the core of the legal agreement between customer and software developer.

Problem Definition

• Setiap pengembangan perangkat lunak harus memiliki persyaratan.

• Persyaratan dibagi menjadi 2, yaitu:• Functional requirements tugas-tugas tertentu yang harus dikerjakan

• Non-functional requirements karakteristik dan kendala-kendala yang diperlukanoleh perangkat lunak. Misalnya hal – hal yang mencakup reliability, safety, security, performance, delivery, and help facilities

• Good list of functional requirements must be:• Clear

• Consistent

• Complete

Problem Definition

Problem Definition

V1

V2

V3

V4

V5

Problem Definition

• The second of the four important problem-solving strategies for a computer scientist is logical reasoning

• Sebagian besar bahasa pemrograman menggunakan perintah IF untuk mencapai tujuan ini:

• IF the user has struck the Confirm Purchase button, THEN initiate billing procedures

• IF the camera sensor detects adequate exposure, THEN close the camera shutter

• IF a song has just finished playing, THEN begin playing the nextsong in the playlist

• IF instructions force a programmer to think in logical ways, to consider a computer program as a complex collection of cause-effect relationships.

• A cause-effect relationship consists of a logical condition (the cause) thatforces the program to perform some task (the effect)

Logical Reasoning

Logical Reasoning

• Decomposition techniques are often called divide and conquer strategies.

• The idea is to approach a single problem by separating (dividing) itinto its constituent subproblems, and then to solve (conquer) each subproblem individually

Decomposition : Software Design

Decomposition : Software Design

Decomposition : Software Design

Decomposition : Software Design

Decomposition : Software Design

Decomposition : Software Design

Decomposition : Software Design

• Top-down design is not the only design technique based upon decomposition.

• Another form of software design that is widely used by software engineers today is known as successive prototyping.

• A prototype for a computer program is a partially functioning piece ofsoftware. Typically, a prototype performs some, but not all, of the requirements from the problem definition.

• For example, the prototype may display the proper application window, but when the user clicks buttons nothing happens because the functionality associated with the buttons is not included in the prototype.

Decomposition : Software Design

Decomposition : Software Design

Decomposition : Software Design

• Decomposition is certainly an essential skill for software design, but design is far from the only way that decomposition is used in computing.

• Modern computers often contain multiple processors, also referred to as cores.

• These multicore machines allow for different programs, or different parts of the same program, to execute simultaneously. The idea that multiple pieces of software execute simultaneously, also known as multitasking, requires that the software be decomposed.

Decomposition : Other Uses

• In fact, data decomposition is so important that there is an entire field of computing known as data organization.

• As an example of decomposing data, we examine two search algorithms.

• A linear search requires that the group of items be arranged one after another from first to last.

• Binary search: Each step of a binary search examines the middle item of the remaining group. By comparing the middle item to the sought item, half of the group can be eliminated from further consideration in this search.

Decomposition : Other Uses

• Algoritma terdiri dari lima struktur kontrol dasar:

ABSTRACTION: CLASS DIAGRAM

• Abstraksi memungkinkan komunikasi lebih ringkas, sekaligus memungkinkanpengguna untuk menggunakan penekanan tertentu.

• Software engineers use abstractions that assist in the problem-solvingprocess.

• Control abstraction is not necessary in an algorithm as simple as the fudge recipe

ABSTRACTION: CLASS DIAGRAM

ABSTRACTION: CLASS DIAGRAM

ABSTRACTION: CLASS DIAGRAM

• Use case diagrams are a technique for depicting a system—software system or some other system—by way of interaction between computer usersand a system.

• The two main components of a use case diagram are actorsand use cases.

ABSTRACTION: USE CASE DIAGRAMS

• Use case diagrams may also depict relationships between actions.

• Two of the more common relationships are labeled «extend» and «include».

• An «extend» relationship occurs whenever one action is an extension orspecialized version of another.

• An «include» relationship results from one action making use of another as part of its function.

ABSTRACTION: USE CASE DIAGRAMS

ABSTRACTION: USE CASE DIAGRAMS

Thank You…

SUMMARY