Anda di halaman 1dari 5

FM-BINUS-AA-FPU-579/R3

BINUS University
BINUS ONLINE LEARNING Semester: Odd/ Even *)
Period: 1 / 2 *)
 Graduate Program  Undergraduate Program
Academic Year:
 Final Exam  Others Exam:
2019/2020
Faculty / Dept. : Computer Science
Student ID :
Course : COMP6284 - Code Reengineering
Day/ Date : Selasa - Senin/ 18 - 24 Agustus 2020
Name :
BULC : Bekasi, Jakarta, Malang, Palembang
Class : TCCA, TGCA, THCA
Time : 00.00 – 12.00 WIB
Signature :
Exam Feature : Open/ Close Books*)
Equipment : Exam Booklet / Calculator / Laptop )

) Strikethrough the unnecessary items
Please insert this test paper into the exam booklet and submit both documents after the test!!!
The penalty for CHEATING is DROP OUT!!!

PETUNJUK UJIAN
i. Jawablah setiap pertanyaan yang berada pada bagian PERTANYAAN UJIAN dibawah ini
ii. Jawaban di ketik rapi pada halaman JAWABAN UJIAN dibawah ini
iii. Jawaban dikumpulkan paling lambat tanggal 24 Agusutus 2020 dalam bentuk file dan submit melalui portal ujian
iv. Format file Jawaban adalah : KodeMatakuliah-Nama Matakuliah-NIM.pdf
Contoh : COMP6284-Code Reengineering-2012345678.pdf

PERTANYAAN UJIAN

No. Deskripsi Soal Bobot


1 Jelaskan mengenai pentingnya refactoring dan bagaimana implementasi best practice dalam 12
kode!

2 Jelaskan kenapa ke-2 bagian di bawah merupakan bagian dari Bloater ? Beri keterangan 12
masing-masing.

1. Long Parameter List


2. Data Clumps

3 Jelaskan mengapa Refused Bequest merupakan bagian dari Object Orientation Abuser? Berikan 12
contohnya!

4 Apa itu Shotgun Surgery? Mengapa dicategorikan sebagai code smell tipe Change Preventer 12
dan bagaimana cara penanganannya bila sudah terjadi? Apakah hal ini dapat dihindari?

5 Jelaskan hal berikut: 12

• Dead Code
• Speculative Generality

Bagaimana mekanisme cara mengatasinya?

6 Tulislah rangkaian kode menggunakan abstraction sehingga menghasilkan clean code. 20


Sebuah perusahaan minuman mempunyai produk dengan kriteria sebagai berikut :

Ukuran minuman : kecil, sedang, dan besar


Macam isian : bubble, keju, dan agar - agar.

Biaya minuman adalah:


Kecil: Rp 10.000
Sedang : Rp 20.000
Besar : Rp 30.000

Biaya per isian = @Rp2.000

Output yang dihasilkan adalah :

EHY | Page 1 of 4
FM-BINUS-AA-FPU-579/R3

No. Deskripsi Soal Bobot


Size Minuman : besar
Toppings Bubble: 1
Toppings Keju : 1
Toppings Agar - Agar : 2
Total harga : Rp 38.000

7 FlightData 20
+flightNo : String
+plane : PlaneData Flight
+flightDate : Date
+destinationAirport : String -flightData : FlightData
+departureAirport : String ----------------------------------------------------------------------------
+arriveTime : String +getAllFlight() : List<Flight>
+departTime : String +setPlaneNo(planeNo : String) : void
+passenger : List<Passenger> +getPlaneNo() : String
+setPlaneName(planeName : String) : void
+getPlaneName() : String
+setCapacity(capacity : int) : void
+getCapacity() : int
+setFlightNo(flightNo : String) : void
+setDestinationAirport(destinationAirport : String) : void
+getDestinationAirport() : String
+setDepartureAirport(departureAirport : String) : void
PlaneData
+getDepartureAirport() : String
+planeNo : String +getFlightDate() : Date
+planeName : String +setFlightDate(flightDate : Date) : void
+capacity : int +getArriveTime() : String
+setArriveTime(arriveTime : String) : void
+setDepartTime(departTime : String) : void
+getDepartTime() : String
+getPassenger() : List<Passenger>
+setPassenger(passenger : List<Passenger>) : void
+addPassenger(passenger : Passenger) : void
+removePassenger(passenger : Passenger) : void
+getAllFlight() : List<Flight>
Passenger
+passengerName : String
+bookingCode : String
+identityNumber : String

Temukan Hierarchy smell, dalam kode berikut sehubungan dengan design diagram di atas!

Passager.java

FlightData.java

EHY | Page 2 of 4
FM-BINUS-AA-FPU-579/R3

No. Deskripsi Soal Bobot

Flight.java

EHY | Page 3 of 4
FM-BINUS-AA-FPU-579/R3

RUBRIK PENILAIAN
LO SKORE : % dari Bobot NILAI
Bobot KONTEN / ELEMEN Skor x
Level (85 <= 100) (75 <= 84) (65 <= 74) (<= 64) bobot

Able to analyse Able to analyse Not able to


LO1 Evaluate Basic Able to analyse code
code smell, but not code smell in analyse code
Evaluate refactoring and its smell in detail and with 1
12 detail and with detail and smell in detail and
application example
example without example without example

Able to analyse Able to analyse Not able to


LO1 Evaluate Basic Able to analyse code
code smell, but not code smell in analyse code
Evaluate refactoring and its smell in detail and with 2
12
detail and with detail and smell in detail and
application example
example without example without example

Able to analyse Able to analyse Not able to


LO1 Evaluate Basic Able to analyse code
code smell, but not code smell in analyse code
Evaluate refactoring and its smell in detail and with 3
12 detail and with detail and smell in detail and
application example
example without example without example

Able to analyse Able to analyse Not able to


LO1 Evaluate Basic Able to analyse code
code smell, but not code smell in analyse code
Evaluate refactoring and its smell in detail and with 4
12
detail and with detail and smell in detail and
application example
example without example without example

Able to analyse Able to analyse Not able to


LO1 Evaluate Basic Able to analyse code
code smell, but not code smell in analyse code
Evaluate refactoring and its smell in detail and with 5
12 detail and with detail and smell in detail and
application example
example without example without example
Apply Advanced Able to apply Able to apply Able to apply Not able to apply
LO2
refactoring and its refactoring in right refactoring in right refactoring in refactoring in
Apply 6
20
application to cases and right code cases but wrong wrong cases and right cases and
Abstraction Smell smell code smell right code smell right code smell
Not able to
Formulate Able to formulate
Able to formulate formulate
suitable Able to formulate suitable
suitable refactoring suitable
LO3 refactoring for suitable refactoring for refactoring for
for code refactoring for
Formulate code code environment in code environment 7
20
environment in code
environment right cases and right in wrong cases
right cases but environment in
using Hierarchy code smell and right code
wrong code smell right cases and
Smell smell
right code smell
TOTAL NILAI UJIAN

EHY | Page 4 of 4
FM-BINUS-AA-FPU-579/R3

JAWABAN UJIAN

Anda mungkin juga menyukai