IMPLEMENTASI SISTEM DETEKSI KESALAHAN SOURCE CODE PHP MENGGUNAKAN TEKNIK KOMPILASI

 Nama : Muhammad Dzaky Azmi Ar Rafi

Nim : 202031054

 1. Pendahuluan 

1.1. LATAR BELAKANG 

Laboratorium praktikum pemrograman PHP  Prodi Teknik Infomatika Sekolah Tinggi Teknologi Wastukancana sebagai tempat pembelajaran bagi para mahasiswa informatika yang mengikuti kelas Algoritma dan Pemrograman. Praktikum pemrograman sebagai salah satu media pengukur tingkat pemahaman mahasiswa dalam hal membuat program PHP.  

Permasalahan yang terjadi, banyaknya source code tugas mahasiswa yang harus diperiksa oleh Dosen mengakibatkan sulitnya melakukan pemeriksaan. Pemeriksaan yang dilakukan untuk mengetahui apakah ada kesalahan source code  di dalam tugas mahasiswa. Kesalahan source code terdiri dari tiga kesalahan yaitu kesalahan leksikal,sintaks, dan semantik. 

Pemeriksaan kesalahan source code dapat menggunakan Teknik kompilasi yang terdiri tiga tahap, yaitu tahap analisis leksikal, analisis sintaks, dan analisis semantik. Dalam penelitian ini yang dibahas hanya tahap analisis leksikal. Analisis leksikal ini meliputi pengubahan source code dari program sumber kedalam jenis token 

identifier,keyword,delimeter,operator,konstanta string, dan konstanta numerik. Kemudian dilakukan pemeriksaan source code yang telah menjadi token.  Jika ditemukan  token yang tidak sesuai maka program akan mencatatnya sebagai suatu kesalahan. Setelah semua token diperiksa selanjutnya dilakukan perhitungan nilai tugas  

1.2. RUMUSAN MASALAH 

Berdasarkan uraian latar belakang diatas, maka rumusan masalah yang diambil peneliti adalah sebagai berikut : 

1. Bagaimana merancang  perangkat lunak sistem deteksi kesalahan source code PHP ? 

2. Bagaimana membangun perangkat lunak sistem deteksi kesalahan source code PHP ? 


2. Tinjauan Pustaka 

2.1.  Teknik Kompilasi  

Menurut Utdirartatmo (200), Teknik kompilasi merupakan teknik dalam melakukan pembacaan suatu program yang ditulis dalam bahasa sumber, kemudian diterjemahkan ke dalam suatu bahasa lain yang disebut bahasa sasaran. Dalam melakukan proses penerjemahan tersebut, sudah barang tentu kompilator akan melaporkan adanya keanehan-keanehan atau kesalahan yang mungkin ditemukannya. Proses kompilasi dari suatu kompilator pada dasarnya dapat dibagi ke dalam 2 bagian utama yaitu bagian analisis dan bagian sintesis. Secara umum proses dalam tahap analis terdiri dari 3 bagian utama, yaitu : 

1. Proses analisis leksikal 

2. Proses analisis sintaktik 

3. Proses analisis semantik 

2.2. Analisis Leksikal  

Menurut Utdirartatmo(2005),analisis leksikal merupakan fungsi analisis dalam compiler bertugas mendekomposisi program sumber menjadi bagian-bagian kecil (token). Analisis leksikal atau scanner bertugas mengidentifikasi semua besaran pembangun bahasa (leksikal) yang ada pada source code. Scanner menerima masukan source code berupa serangkaian karakter kemudian memilah-milahnya menjadi bagian-bagian kecil yang mempunyai satu arti yang disebut token, seperti : konstanta, nama variabel, keyword, operator. Token-token ini akan menjadi masukan bagi analisis selanjutnya yaitu analisis sintaksis. Dari fungsi scanner secara umum seperti telah disebutkan di atas, maka tugas scanner secara rinci adalah:  

  1. Membaca serangkaian karakter dari source code.  
  2. Mengenalinya ke dalam satuan leksikal.  
  3. Mengubahnya menjadi token dan menentukan jenis tokennya.  
  4. Mengirimkan token ke proses analisis selanjutnya, yaitu analisis sintaksis.  
  5. Mengabaikan karakter white space (spasi, enter, ganti baris, penanda akhir file) dan komentar (remark) apabila ada di dalam source code.  
  6. Menangani error.  

2.3. Jenis Token 

Token adalah satuan terkecil dari bahasa sumber yaitu deretan karakter terpendek yang mengandung arti. Token dikelompokan menjadi beberapa jenis sebagai  berikut 

  1. Identifier 
  2. Konstanta 
  3. Keyword 
  4. Operator 
  5. Delimiter 

2.4. Contoh  Token dalam  Bahasa Pemrograman PHP            

Tabel 2.1 Jenis Token 

2.5. Kesalahan Source Code 

Kesalahan source code dapat dibedakan menjadi  tiga  jenis  kesaahan,  yaitu  kesalahan leksikal,kesalahan,sintak, dan kesalahan semantik.  

Kesalahan leksikal diantaranya : 

1.     Kesalahan ada karakter yang bukan huruf dan angka di dalam token identifier 

2. Kesalahan ada karakter angka pada digit pertama token identifier 

3. Kesalahan penulisan nama token keyword 

2.6. Rekayasa Perangkat Lunak 

Istilah Rekayasa Perangkat Lunak (RPL) secara umum disepakati sebagai terjemahan dari istilah Software Engineering. Istilah Software Engineering mulai dipopulerkan tahun 1968 pada Software Engineering Conference yang diselenggarakan oleh NATO. Sebagian orang mengartikan RPL hanya sebatas pada bagaimana membuat program komputer. Padahal ada perbedaan yang mendasar antara perangkat lunak (software) dan program komputer. 

2.7. Unified Modelling Language (UML) 

Menurut Munawar(2005), Unified Modelling Language (UML) adalah sebuah “bahasa” yang telah menjadi standar dalam industri untuk visualisasi, merancang dan mendokumentasikan sistem perangkat lunak. UML menawarkan sebuah standar untuk merancang model sebuah sistem. Dengan menggunakan UML, kita dapat membuat model untuk semua jenis aplikasi perangkat lunak, dimana aplikasi tersebut dapat berjalan para perangkat keras, sistem operasi dan jaringan apapun. 

UML sebagai salah satu alat bantu yang sering digunakan di dunia pengembangan sistem yang berorientasi objek. Hal ini disebabkan karena UML menyediakan bahasa pemodelan visual yang memungkinkan bagi pengembang sistem untuk membuat cetak biru atas visi mereka dalam bentuk yang baku, mudah dimengerti serta dilengkapi dengan mekanisme yang efektif untuk berbagi (sharing) dan mengkomunikasikan rancangan mereka dengan yang lain . 

2.8.  USE CASE DIAGRAM 

Menurut Munawar(2005), use case adalah deskripsi sebuah sistem dari perspektif pengguna. Use case bekerja dengan cara mendeskripsikan tipikal interaksi antar user (pengguna) sebuah sistem dengan sistemnya sendiri melalui sebuah cerita bagaimana sebuah sistem dipakai (Munawar, 2005). 

2.9. Activity Diagram 

Menurut Munawar(2005), activity diagram adalah teknik untuk menggambarkan logika procedural proses bisnis dan aliran kerja dalam banyak kasus. Activity diagram mempunyai peran seperti halnya flowchart akan tetapi perbedaannya dengan flowchart adalah activity diagram bisa mendukung perilaku paralel sedangkan flowchart tidak  

2.10.  BAHASA PEMROGRAMAN PHP 

Menurut Kadir (2002) , PHP merupakan bahasa berbentuk script yang ditempatkan pada server dan diproses server lalu hasilnya dikirim ke client, dimana client menerima atau melihat hasil yang dikirimkan oleh server  dengan  menggunakan  web  browser.  Sebagian  besar  web  yang  ada  di internet dibangun dengan menggunakan bahasa pemograman PHP. Beberapa alasan penggunaan PHP adalah : 

a. PHP merupakan bahasa pemograman Open Source dan dikembangkan oleh komunitas tersebut sehingga bisa didapatkan dengan mudah dan digunakan tanpa harus 

mengeluarkan biaya 

b. PHP dapat digunakan pada sistem operasi seperti Linux, Microsoft Windows, Solaris, Mac OS X, Open BSD, dan RISK OS. 

c. PHP didukung oleh beberapa web server seperti Apache, Personal  Web Server, dan Internet Information Server. 

d. Dalam penggunaannya PHP mendukung beberapa database seperti Interbase, PostgreSQL, Sybase, Mysql, FrontBase, SQLite, Informix, Oracle, dan ODBC. 

e. PHP juga memberikan kemudahan dalam menampilkan berbagai macam teks, gambar dan file PDF. 

2.11. BLACK-BOX TESTING Black-Box Testing berfokus pada persyaratan fungsional perangkat lunak yang memungkinkan engineers untuk memperoleh set kondisi input yang sepenuhnya akan melaksanakan persyaratan fungsional untuk sebuah program (Pressman, 2010). Black-Box testing berusaha untuk menemukan kesalahan dalam kategori berikut: 

1. Fungsi yang tidak benar atau fungsi yang hilang. 

2. Kesalahan antarmuka. 

3. Kesalahan dalam struktur data atau akses database eksternal. 

4. Kesalahan perilaku (behavior) atau kesalahan kinerja. 

5. Inisialisasi dan pemutusan kesalahan. 


3. Metode Penelitian 

Metode pengembangan perangkat lunak menggunakan paradigma pengembangan perangkat lunak waterfall. Menurut  Waterfall adalah sebuah pengembangan model perangkat lunak yang dilakukan secara berurutan atau sekuensial, adapun tahapan model ini sebagai berikut: 

        1) Analysis, 

        2) Design, 

        3) Coding, dan 

        4) Testing  


3.1. Tahapan sistem deteksi kesalahan  source code php 

1. Menguraikan  isi surce code file program php ke dalam kelompok jenis token menggunakan analisis leksikal. 

2. Mendeteksi karakter yang bukan huruf dan angka pada token identifier . 

3. Mendeteksi karakter  angka pada digit pertama isi token identifier . 

4. Mendeteksi kesalahan penulisan token keyword. 

5. Menghitung skor kesalahan source code 


3.2.  ANALISIS KEBUTUHAN NON FUNGSIONAL  

Analisis kebutuhan non fungsional ini meliputi analisis kebutuhan perangkat keras (hardware), dan perangkat lunak (software) yang digunakan dalam membangun sistem. 

3.2.1 Analisis  Kebutuhan Perangkat Keras (Hardware) 

Spesifikasi perangkat keras yang dibutuhkan antara lain sebagai berikut : 

1. Prosesor Intel atom 1,8GHz  

2. Chipset Intel  

3. Grafis Intel HD Graphics 5500  

4. Memori RAM 2GB  

5. Storage hard disk 300GB 5400 rpm  

3.2.2. Analisis Kebutuhan Perangkat Lunak (Software) 

Spesifikasi perangkat lunak yang dibutuhkan antara lain sebagai berikut : 

1. Sistem operasi Microsoft Windows 7 Enterprise 32bit, 

2. Bahasa pemrograman PHP 


3.3. DESAIN SISTEM 

3.3.1. Desain UML (Unified Modelling Language) 

3.3.1.1. Use Case Diagram  

Dalam tahap ini akan dijelaskan untuk mendeskripsikan apa yang harus dilakukan oleh sistem, digambarkan dalam bentuk use case yang bertujuan untuk menunjukkan alur kerja dan proses dari sistem aplikasi yang akan dibuat. Use Case Diagram atau diagram use case merupakan pemodelan untuk menggambarkan kelakuan (behavior) sistem yang akan dibuat, diagram use case mendeskripsikan sebuah interaksi antara satu atau lebih actor dengan sistem yang akan dibuat. Proses yang akan digambarkan akan berlangsung secara terstruktur. Berikut merupakan gambaran use case diagram untuk sistem yang akan dibangun pada gambar 3.1 : 

 


                                                             Gambar 3.1. Use Case Diagram Sistem 

3.3.1.2 Activity Diagram 

Activity diagram adalah salah satu cara untuk memodelkan event-event yang terjadi dalam suatu use case.  Berikut merupakan gambaran activity diagram untuk sistem  yang akan dibangun pada gambar 3.2 : 

 

 Gambar 3.2. Activity Diagram Sistem 


4. Hasil dan Pembahasan 

4. 1. Implementasi 

Implementasi merupakan kelanjutan dari kegiatan perancangan sistem. Tahap ini merupakan tahap meletakkan sistem supaya siap untuk di operasikan dan dapat dipandang sebagai usaha untuk mewujudkan sistem yang telah di rancang. Pada tahap ini akan diambil tiga sampel tugas mahasiswa yang akan diperiksa kesalahan-kesalahan source code yang berhasil terdeteksi. Hasil pengujian adalah kesalahan source code  diambil secara random dari tugas mahasiswa. 

1. File Tugas 16135009  

Pada sampel pertama, sistem mendeteksi ada kesalahan  source code penulisan identifier. Isi file source code program  sampel  pertama dapat dilihat di gambar 4.1,  Dengan menggunakan sistem pendeteksi kesalahan source code dapat dideteksi kesalahan source code pada sampel  pertama dan diperoleh daftar kesalahan source code dan skor nilai tugas mahasiswa , hasilnya dapat dilihat di gambar 4.2. 

Gambar 4.1. File Sampel 1  


 Gambar 4.2. Hasil Deteksi Sampel 1 

2. File Tugas  16135025  

Pada sampel kedua, sistem mendeteksi ada kesalahan  source code penulisan keyword. Isi file source code program  sampel  kedua dapat dilihat di gambar 4.3,  Dengan menggunakan sistem pendeteksi kesalahan source code dapat dideteksi kesalahan source code pada sampel  kedua dan diperoleh daftar kesalahan source code dan skor nilai tugas mahasiswa , hasilnya dapat dilihat di gambar 4.4. 

      Gambar 4.3. File sampel 2   


Gambar 4.4. Hasil Deteksi Sampel 2 


3. File tugas  16135016 
Pada sampel ketiga, sistem mendeteksi ada kesalahan  source code penulisan identifier dan penulisan keyword. Isi file source code program  sampel  ketiga dapat dilihat di gambar 4.5,  Dengan menggunakan sistem pendeteksi kesalahan source code dapat dideteksi kesalahan source code pada sampel  ketiga dan diperoleh daftar kesalahan source code dan skor nilai tugas mahasiswa , hasilnya dapat dilihat di gambar 4.6. 

                                                              Gambar 4.5. File sampel 3   



      Gambar 4.6. Hasil Deteksi Sampel 3 



4.2. PENGUJIAN 
 
Pengujian yang dilakukan menggunakan teknik pengujian black box yang memfokuskan pada domain fungsional dari perangkat lunak. Hasil pengujian dapat dilihat pada tabel 4.2.1 

                  Tabel 4.2.1.  Hasil Pengujian




5.   KESIMPULAN DAN SARAN 

5.1  KESIMPULAN 
Setelah melakukan tahap penelitian, perancangan, dan tahap implementasi sistem deteksi kesalahan source code dengan menggunakan analisis leksikal, diperoleh kesimpulan sebagai berikut : 
1. Analisis leksikal dapat diimplementasikan untuk mendeteksi kesalahan source code dari file source code  PHP 
2. Hasil dari aplikasi ini berupa daftar kesalahan soouce code PHP, dapat dijadikan acuan untuk penilaian tugas source code PHP .  
 
5.2  SARAN 
Berdasarkan  kesimpulan  diatas  maka  dapat megemukakan beberapa saran yang diharapkan dapat menjadi masukan bagi kemajuan sistem yang akan datang.   
1. Aplikasi ini mendeteksi kesalahan source code  pada bahasa pemrograman PHP, untuk kedepannya diharapkan dapat  mendeteksi lebih dari satu bahasa pemrograman.  
2. Analisis yang digunakan mendeteksi kesalahan source code hanya menggunakan analisis leksikal, kedepannya dapat ditambah dengan analisis sintak dan analisis semantik. 
 
DAFTAR PUSTAKA 
Firrar Utdirartatmo. (2005):Teknik Kompilasi, Graha Ilmu 

Henk Alblas, Albert Nymeyer.1996. Practice and prinsiples of compiler building with C,Prentice Hall,  

Kadir, A.2009. Dasar Pemrograman Web PHP, Penerbit Andi 

Munawar, A. 2005. Pemodelan Visual Dengan UML,Graha Ilmu,Jakarta. 

Michael Sipser. 1997. Introduction to The Theory of Computation, PWS Publishing Company Pressman, R. S. 2010. Software engineering:  a practitioner's approach. Palgrave Macmillan.  

Robin H.1999.The Essence of Compilers, Prentice Hal Europe 





English :

1. Introduction

1.1. BACKGROUND

PHP programming practicum laboratory for Informatics Engineering Study Program Wastukancana College of Technology as a learning place for informatics students who take Algorithm and Programming classes. Programming practicum as one of the media to measure the level of student understanding in terms of making PHP programs.

The problems that occur are the large number of source code student assignments that must be checked by the lecturer, which makes it difficult to carry out inspections. Checks carried out to find out whether there are source code errors in student assignments. Source code errors consist of three errors, namely lexical, syntax, and semantic errors.

Checking for source code errors can use a compilation technique which consists of three stages, namely the lexical analysis, syntax analysis, and semantic analysis stages. In this study, only the lexical analysis stage is discussed. This lexical analysis includes changing the source code of the source program into the token type

identifiers, keywords, delimiters, operators, string constants, and numeric constants. Then check the source code that has become a token. If an inappropriate token is found, the program will record it as an error. After all the tokens have been checked, the calculation of the assignment value is then carried out

1.2. FORMULATION OF THE PROBLEM

Based on the description of the background above, the formulation of the problem taken by the researcher is as follows:

1. How to design a PHP source code error detection system software?

2. How to build a PHP source code error detection system software?



2. Literature Review

2.1. Compilation Techniques

According to Utdiartatmo (200), the compilation technique is a technique for reading a program written in the source language, then translating it into another language called the target language. In carrying out the translation process, of course the compiler will report any oddities or errors that it might find. The compilation process of a compiler can basically be divided into 2 main parts, namely the analysis part and the synthesis part. In general, the process in the analysis stage consists of 3 main parts, namely:

1. The process of lexical analysis

2. Syntactic analysis process

3. Semantic analysis process


2.2. Lexical Analysis

According to Utdiartatmo (2005), lexical analysis is an analysis function in the compiler tasked with decomposing the source program into small parts (tokens). Lexical analysis or scanners are tasked with identifying all the language (lexical) building blocks that exist in the source code. The scanner receives source code input in the form of a series of characters and then sorts it into small parts that have one meaning called tokens, such as: constants, variable names, keywords, operators. These tokens will be input for the next analysis, namely syntax analysis. From the function of the scanner in general as mentioned above, the detailed tasks of the scanner are:

1. Reads a string of characters from the source code.

2. Recognize it into lexical units.

3. Turn it into a token and determine the token type.

4. Sending tokens to the next analysis process, namely syntax analysis.

5. Ignore white space characters (space, enter, line breaks, end of file) and comments (remarks) if they are in the source code.

6. Handling errors.


2.3. Token Type

The token is the smallest unit of the source language, namely the shortest string of characters that has meaning. Tokens are grouped into several types as follows

1. Identifiers

2. Constants

3. Keywords

4. Operators

5. Delimiters
 

2.4. Examples of Tokens in the PHP Programming Language

                     Table 2.1 Types of Tokens


2.5. Source code error

Source code errors can be divided into three types of errors, namely lexical errors, syntax errors, and semantic errors.

Lexical errors include:

1. Error there are characters that are not letters and numbers in the token identifier

2. Error there is a numeric character in the first digit of the token identifier

3. Error writing token keyword name


2.6. Software engineering

The term Software Engineering (RPL) is generally agreed upon as a translation of the term Software Engineering. The term Software Engineering was popularized in 1968 at the Software Engineering Conference organized by NATO. Some people interpret RPL only in terms of how to make computer programs. Though there are fundamental differences between software (software) and computer programs.

2.7. Unified Modeling Language (UML)

According to Munawar (2005), Unified Modeling Language (UML) is a "language" that has become a standard in the industry for visualizing, designing and documenting software systems. UML offers a standard for modeling a system. By using UML, we can create models for all types of software applications, where these applications can run on any hardware, operating system and network.

UML as a tool that is often used in the world of object-oriented system development. This is because UML provides a visual modeling language that allows system developers to create a blueprint for their vision in a standardized form, easy to understand and equipped with an effective mechanism for sharing and communicating their designs with others.

2.8. USE CASE DIAGRAMS

According to Munawar (2005), a use case is a description of a system from the user's perspective. Use cases work by describing typical interactions between users of a system and their own system through a story of how a system is used (Munawar, 2005).

2.9. Activity Diagrams

According to Munawar (2005), activity diagrams are a technique for describing the procedural logic of business processes and workflow in many cases. Activity diagrams have a role like flowcharts, but the difference with flowcharts is that activity diagrams can support parallel behavior while flowcharts do not.

2.10. PHP PROGRAMMING LANGUAGE

According to Kadir (2002), PHP is a language in the form of a script that is placed on a server and processed by the server and then the results are sent to the client, where the client receives or sees the results sent by the server using a web browser. Most of the websites on the internet are built using the PHP programming language. Some of the reasons for using PHP are:

a. PHP is an Open Source programming language and was developed by the community so that it can be obtained easily and used without having to incur costs

b. PHP can be used on operating systems such as Linux, Microsoft Windows, Solaris, Mac OS X, Open BSD, and RISK OS.

c. PHP is supported by several web servers such as Apache, Personal Web Server, and Internet Information Server.

d. In use PHP supports several databases such as Interbase, PostgreSQL, Sybase, Mysql, FrontBase, SQLite, Informix, Oracle, and ODBC.

e. PHP also makes it easy to display various kinds of text, images and PDF files.


2.11. BLACK-BOX TESTING Black-box testing focuses on the functional requirements of software that allows engineers to obtain a set of input conditions that will fully implement the functional requirements for a program (Pressman, 2010). Black-Box testing attempts to find errors in the following categories:

1. Improper function or missing function.

2. Interface error.

3. Error in data structure or external database access.

4. Error behavior (behavior) or performance errors.

5. Initialization and disconnection of faults.



3. Research Methods

The software development method uses the waterfall software development paradigm. According to Waterfall, it is a software model development that is carried out sequentially, while the stages of this model are as follows:

         1) Analysis,

         2) Design,

         3) Coding, and

         4) Testing


3.1. Stages of the php source code error detection system

1. Decompose the contents of the php program source code file into groups of token types using lexical analysis.

2. Detect characters that are not letters and numbers in token identifiers.

3. Detect the numeric character in the first digit of the contents of the token identifier.

4. Detect keyword token writing errors.

5. Compute the source code error score
 

3.2. ANALYSIS OF NON FUNCTIONAL NEEDS

This analysis of non-functional requirements includes analysis of hardware and software requirements used in building the system.

3.2.1 Analysis of Hardware Requirements (Hardware)

The required hardware specifications include the following:

1. 1.8GHz Intel atomic processor

2.Intel Chipsets

3. Graphics Intel HD Graphics 5500

4. 2GB RAM memory

5. Storage hard drive 300GB 5400 rpm

 
3.2.2. Software Requirements Analysis (Software)

The required software specifications include the following:

1. Microsoft Windows 7 Enterprise 32bit operating system,

2. PHP programming language


3.3. SYSTEM DESIGN

3.3.1. UML (Unified Modeling Language) Design

3.3.1.1. Use Case Diagrams
In this stage it will be explained to describe what the system must do, described in the form of a use case which aims to show the workflow and process of the application system to be made. Use Case Diagrams or use case diagrams are modeling to describe the behavior of the system to be created, use case diagrams describe an interaction between one or more actors and the system to be created. The process that will be described will take place in a structured manner. The following is an illustration of the use case diagram for the system to be built in Figure 3.1:

Figure 3.1. Use Case System Diagram


3.3.1.2 Activity Diagrams

Activity diagrams are one way to model the events that occur in a use case. The following is an overview of the activity diagram for the system to be built in Figure 3.2:
Figure 3.2. System Activity Diagrams

4. Results and Discussion

4. 1. Implementation

Implementation is a continuation of system design activities. This stage is the stage of laying the system so that it is ready to operate and can be seen as an attempt to realize the system that has been designed. At this stage three samples of student work will be taken which will be examined for detected source code errors. The result of the test is that source code errors are taken randomly from student assignments.

1. Task File 16135009

In the first sample, the system detected an error in the source code for writing the identifier. The contents of the source code file for the first sample program can be seen in Figure 4.1. By using a source code error detection system, source code errors can be detected in the first sample and a list of source code errors and student assignment scores can be obtained, the results can be seen in Figure 4.2.

Figure 4.1. Sample Files 1


Figure 4.2. Sample Detection Results 1

2. Task File 16135025

In the second sample, the system detected an error in the keyword source code. The contents of the second sample program source code file can be seen in Figure 4.3. Using a source code error detection system, source code errors can be detected in the second sample and a list of source code errors and student assignment scores can be obtained, the results can be seen in Figure 4.4.
    Figure 4.3. Sample files 2

Figure 4.4. Sample Detection Results 2

3. Task file 16135016
In the third sample, the system detected an error in the source code for writing identifiers and writing keywords. The contents of the source code file for the third sample program can be seen in Figure 4.5. Using a source code error detection system, source code errors can be detected in the third sample and a list of source code errors and student assignment scores can be obtained. The results can be seen in Figure 4.6.

                                                             Figure 4.5. Sample files 3



      Figure 4.6. Sample Detection Results 3
4.2. TESTING
 
Tests carried out using black box testing techniques that focus on the functional domain of the software. The test results can be seen in table 4.2.1

Table 4.2.1. Test result


5. CONCLUSIONS AND SUGGESTIONS

5.1 CONCLUSION
After carrying out the research, design, and implementation stages of the source code error detection system using lexical analysis, the following conclusions are obtained:
1. Lexical analysis can be implemented to detect source code errors from PHP source code files
2. The results of this application are a list of PHP source code errors, which can be used as a reference for evaluating PHP source code assignments.
 
5.2 ADVICE
Based on the conclusions above, several suggestions can be made which are expected to be input for the progress of the system in the future.
1. This application detects source code errors in the PHP programming language, in the future it is hoped that it can detect more than one programming language.
2. The analysis used to detect source code errors only uses lexical analysis, in the future it can be added with syntax analysis and semantic analysis.
 

BIBLIOGRAPHY

Firrar Utdirartatmo. (2005): Compilation Techniques, Graha Ilmu

Henk Alblas, Albert Nymeyer. 1996. Practice and principles of compiler building with C,Prentice Hall,

Kadir, A. 2009. Basic PHP Web Programming, Andi Publisher

Munawar, A. 2005. Visual Modeling with UML, Graha Ilmu, Jakarta.

Michael Sipser. 1997. Introduction to The Theory of Computation, PWS Publishing Company Pressman, R. S. 2010. Software engineering: a practitioner's approach. Palgrave Macmillan.

Robin H. 1999. The Essence of Compilers, Prentice Hal Europe


Sumber : https://stt-wastukancana.ac.id/jurnal/download/7.1.9.imay.pdf


Komentar