riset-teknologi-informasi/worksheets/ws-09-implementation.md
hb_alim b488de8a09 feat: rewrite all 16 worksheets with full learning material
Each worksheet now includes Ringkasan Materi, Template A.x,
3 exercises with example answers, and reflection prompts.
Synced from rti-20252 student repo.
2026-03-31 10:58:25 +07:00

177 lines
5.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# WS-09: Implementation & Environment
> **Bab 9 — Implementasi Riset & Kontrol Lingkungan**
---
## Ringkasan Materi
### Implementasi Riset ≠ Coding Biasa
Tujuan implementasi riset bukan membuat software yang berfungsi, melainkan membangun **instrumen pengukuran yang konsisten**. Setiap modul harus di-mapping ke variabel (dari Bab 6), parameter harus config-driven, dan logging aktif dari hari pertama.
### Reproducible Implementation Model
```
Design → Implementation → Environment Setup → Execution Consistency → Reproducibility → Trustworthy Result
```
Setiap transisi memiliki syarat:
- Design → Implementation: kode sesuai mapping variabel-ke-komponen
- Implementation → Environment: versi, dependency, seed, path, OS eksplisit
- Environment → Consistency: seed terkunci, urutan deterministik
- Consistency → Reproducibility: dokumentasi lengkap
- Reproducibility → Trust: siapa pun ikuti dokumentasi → hasil sama/serupa
### Repeatability vs Reproducibility
| Level | Peneliti | Environment | Hasil |
|-------|---------|-------------|-------|
| **Repeatability** | Sama | Sama | Sama persis |
| **Reproducibility** | Berbeda | Berbeda (ikuti docs) | Sama/serupa |
Capai **repeatability** dulu, baru **reproducibility**.
### Engineering vs Research Perspective
| Aspek | Engineering | Research |
|-------|-----------|---------|
| Tujuan | Sistem berfungsi untuk user | Instrumen pengukuran konsisten |
| Dependency | Update ke terbaru | Lock di versi spesifik |
| Testing | Unit, integration, E2E | Repeatability test (run ulang → sama?) |
| Dokumentasi | User guide, API docs | Environment spec, execution steps, expected output |
| Config | Default masuk akal | Setiap parameter eksplisit & adjustable |
### Jebakan Kognitif
1. Menunda environment setup → bug sulit dilacak
2. Tidak pakai version control → hasil tidak bisa direkonstruksi
3. Menolak Docker/container → "di laptop saya bisa" saat review
4. 3× hasil sama ≠ repeatable (bisa cache/state tersimpan)
### Istilah Penting
- **Environment Specification** — Deskripsi lengkap: hardware, OS, runtime, library + versi, config, seed
- **Dependency** — Komponen eksternal yang harus di-lock versinya
- **Config-driven** — Parameter dieksternalisasi ke file konfigurasi, bukan hardcode
---
## Template A.9 — Dokumentasi Setup Eksperimen
```
EXPERIMENT SETUP DOCUMENTATION
Hardware:
CPU : ____________________
RAM : ____________________
GPU : ____________________
Storage : ____________________
Software:
OS : ____________________
Runtime : ____________________
Framework : ____________________
Dependencies:
| Library | Version | Sumber | Hash/Checksum |
|---------|---------|--------|---------------|
| | | | |
| | | | |
Konfigurasi:
Config file : ____________________
Random seed : ____________________
Hyperparameters : ____________________
Reproducibility Check:
[ ] Dependency terdokumentasi (requirements.txt / lock file)
[ ] Seed ditetapkan di semua level (Python, NumPy, framework)
[ ] Config di version control
[ ] README instruksi reproduksi lengkap
```
---
## Latihan 1 — Environment Specification
Dokumentasikan environment untuk eksperimen Anda (boleh environment saat ini atau yang direncanakan).
| Komponen | Spesifikasi |
|----------|------------|
| CPU | *Contoh: Intel Core i7-12700H, 14 Core* |
| RAM | *Contoh: 32 GB DDR5* |
| GPU | *Contoh: NVIDIA RTX 3060 6GB / CPU-only jika tidak ada GPU* |
| OS | *Contoh: Ubuntu 22.04 LTS / Windows 11* |
| Runtime | |
| Framework | |
| Random Seed | |
**Dependencies (minimal 5):**
| Library | Version | Alasan Dibutuhkan |
|---------|---------|-------------------|
| *Contoh: scikit-learn* | *1.3.2* | *Klasifikasi + evaluasi metrik* |
| | | |
| | | |
| | | |
| | | |
---
## Latihan 2 — Repeatability Test Plan
Rancang tes repeatability sederhana: jalankan kode yang sama 3× di environment yang sama.
| Run | Seed | Metrik Utama | Hasil Sama? |
|-----|------|-------------|-------------|
| 1 | *Contoh: 42* | *Contoh: Accuracy* | — |
| 2 | | | [ ] Ya / [ ] Tidak |
| 3 | | | [ ] Ya / [ ] Tidak |
**Jika hasil berbeda, kemungkinan penyebab:**
> ___________________________________________________
**Checklist kontrol yang sudah diterapkan:**
- [ ] Random seed di-set di semua level
- [ ] Tidak ada background process yang mengganggu
- [ ] Cache dibersihkan antar-run
- [ ] Config file yang sama untuk semua run
---
## Latihan 3 — README Eksperimen
Tulis README minimum untuk eksperimen Anda (6 komponen wajib).
```
# Judul Eksperimen: ____________________
## 1. Environment
> (Salin spesifikasi dari Latihan 1)
## 2. Installation
> (Langkah instalasi, misal: "pip install -r requirements.txt")
## 3. Data
> (Deskripsi data: sumber, format, ukuran)
## 4. Execution
> (Command untuk menjalankan eksperimen)
## 5. Configuration
> (File config yang digunakan + parameter kunci)
## 6. Expected Output
> (Contoh output yang diharapkan + format)
```
---
## Refleksi
> Apakah eksperimen Anda saat ini bisa direproduksi oleh orang lain tanpa bantuan Anda? Komponen apa yang masih hilang?
**Level saat ini:** [ ] Repeatability / [ ] Reproducibility / [ ] Belum keduanya
**Komponen yang belum terdokumentasi:**
> ___________________________________________________