BRYN MAWR Identifying and Correcting Java Programming Errors for Introductory Computer Science Students Maria Hristova, Ananya Misra,Megan Rutter Rebecca.

Slides:



Advertisements
Similar presentations
Chapter 15 Debugging. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Debugging with High Level Languages.
Advertisements

Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Chapter 1: Introduction
A Review. a review of lessons learned so far… ( 2 steps forward - 1 step back) Software Development Cycle: design, implement, test, debug, document Large.
Identifying and Correcting Common Java Programming Errors And Misconceptions for Introductory Computer Science Students Maria Hristova Ananya Misra Megan.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
How to Create a Java program CS115 Fall George Koutsogiannakis.
1 Chapter 2 Introductory Programs. 2 Getting started To create and run a Java program –Create a text file with a.java extension for the source code. For.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
By: Mr. Baha Hanene Chapter 3. Learning Outcomes We will cover the learning outcome 02 in this chapter i.e. Use basic data-types and input / output in.
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
METHODS Introduction to Systems Programming - COMP 1005, 1405 Instructor : Behnam Hajian
ERROR HANDLING Lecture on 27/08/2013 PPT: 11CS10037 SAHIL ARORA.
UNIT 3 TEMPLATE AND EXCEPTION HANDLING. Introduction  Program errors are also referred to as program bugs.  A C program may have one or more of four.
Chapter 6: User-Defined Functions I Instructor: Mohammad Mojaddam
C++ for Engineers and Scientists Third Edition
LESSON 2 CREATING A JAVA APPLICATION JAVA PROGRAMMING Compiled By: Edwin O. Okech [Tutor, Amoud University]
CIS Computer Programming Logic
INTRODUCTION TO COMPUTING CHAPTER NO. 06. Compilers and Language Translation Introduction The Compilation Process Phase 1 – Lexical Analysis Phase 2 –
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
Chapter 6: Modularity Using Functions. In this chapter, you will learn about: – Function and parameter declarations – Returning a single value – Returning.
Programming With C.
Project 1 Due Date: September 25 th Quiz 4 is due September 28 th Quiz 5 is due October2th 1.
Week 1 - Friday.  What did we talk about last time?  Our first Java program.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
COMPUTER PROGRAMMING. A Typical C++ Environment Phases of C++ Programs: 1- Edit 2- Preprocess 3- Compile 4- Link 5- Load 6- Execute Loader Primary Memory.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Fundamental Programming: Fundamental Programming Introduction to C++
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 7 Clicker Questions September 22, 2009.
Jeliot – A powerful Java tutor for beginners Boro Jakimovski Institute of Informatics Faculty of Natural Sciences and Mathematics University “Ss Cyril.
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
The Functions and Purposes of Translators Syntax (& Semantic) Analysis.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
#include using namespace std; // Declare a function. void check(int, double, double); int main() { check(1, 2.3, 4.56); check(7, 8.9, 10.11); } void check(int.
1 CS161 Introduction to Computer Science Topic #8.
TCU CoSc Introduction to Programming (with Java) Java Language Overview.
Functions Math library functions Function definition Function invocation Argument passing Scope of an variable Programming 1 DCT 1033.
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
CS116 COMPILER ERRORS George Koutsogiannakis 1. How to work with compiler Errors The Compiler provide error messages to help you debug your code. The.
Repetition Statements (Loops). 2 Introduction to Loops We all know that much of the work a computer does is repeated many times. When a program repeats.
FUNCTIONS. Midterm questions (1-10) review 1. Every line in a C program should end with a semicolon. 2. In C language lowercase letters are significant.
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
Intro. to Computer Programming Eng. Nehal A. Mohamed Spring Semester-2016.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Introduction to Java Import Scanner class to use in our program
Working with Java.
CSCI-235 Micro-Computer Applications
Compilation and Debugging
Compilation and Debugging
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Introduction to C Topics Compilation Using the gcc Compiler
Programmazione I a.a. 2017/2018.
Chapter 2 – Getting Started
Programming Errors Key Revision Points.
Programming Fundamentals Lecture #3 Overview of Computer Programming
An Introduction to Debugging
General Computer Science for Engineers CISC 106 Lecture 03
An Overview of C.
Introduction to Programming - 1
Chapter 15 Debugging.
WJEC GCSE Computer Science
Zorah Fung University of Washington, Winter 2016
Chapter 15 Debugging.
Presentation transcript:

BRYN MAWR Identifying and Correcting Java Programming Errors for Introductory Computer Science Students Maria Hristova, Ananya Misra,Megan Rutter Rebecca Mercuri, Ph.D. Mathematics and Computer Science Department Bryn Mawr College

BRYN MAWR Java Programming Errors SIGCSE 2003 Purpose of the Study Beginning programmers often find it difficult to understand some of the linguistic constructs in the C/C++/Java family of languages. This results in certain common errors during the coding process. Students may be further confused from cryptic diagnostic messages issued by the compiler. We wanted to study this problem using Java in the CS1 environment.

BRYN MAWR Java Programming Errors SIGCSE 2003 Project Funding Support was provided for 3 Bryn Mawr Math/CS students (2 Seniors and 1 Junior) to perform this research with their Professor. Funding was received from the Collaborative Research Experience for Women (CRE-W) program, part of the Computer Research Association (CRA). The students received academic credit for this project.

BRYN MAWR Java Programming Errors SIGCSE 2003 Project Goal The creation of an educational tool that would help students identify and fix their programming errors, and also teach them how to avoid making these coding mistakes again.

BRYN MAWR Java Programming Errors SIGCSE 2003 Project Phases I: Identification of Errors Java professors, TAs, and students were surveyed from 50 schools. They were asked to identify the most common programming errors made by introductory students, as well as the hardest ones to find, after compilation reported their mistakes. 62 errors were identified, 20 deemed essential to the project.

BRYN MAWR Java Programming Errors SIGCSE 2003 Project Phases I: Identification of Errors II: Choice of Implementation Existing educational tools were examined: TA Online, DrScheme, BlueJ Intention was to create a tool that could be used in the early stages of learning programming. The tool should do a better job generating understandable error messages than existing compilers, and provide suggestions regarding how to fix the code.

BRYN MAWR Java Programming Errors SIGCSE 2003 Project Phases I: Identification of Errors II: Choice of Implementation III: Implementation “Expresso” -- a multi-pass Java pre-processor, written in C++: –strips comments, retains line numbering –removes whitespace and tokenizes the file –detects and reports mistakes in additional passes Created a test suite of short programs to exercise the individual errors that Expresso could identify.

BRYN MAWR Java Programming Errors SIGCSE 2003 Project Phases I: Identification of Errors II: Choice of Implementation III: Implementation IV: Evaluation TAs for the Fall’02 CS1 Java course were provided with copies of Expresso for experimental use. More extensive testing in the programming laboratory setting will be explored.

BRYN MAWR Java Programming Errors SIGCSE 2003 Types of Errors Implemented: Syntax - spelling, punctuation and order of words in the program Semantic - likely to ensue from a mistaken idea of how the language interprets certain instructions Logic - tend to arise from fallacious thinking by the programmer rather than from language peculiarities Unimplemented: –Already identified well by the compiler –Don’t apply to introductory students –Can’t be checked by preprocessor

BRYN MAWR Java Programming Errors SIGCSE 2003 Syntax Errors 1. = versus == 2. == versus.equals 3.mismatching, miscounting and misuse of ( ), [ ], { }, “ “, ‘ ‘ 4.&& versus & and || versus | 5.semicolon after if/for/while test 6.wrong separators in for loops 7.if followed by { instead of ( 8.keywords used as method or variable names 9.invoking methods with wrong arguments 10.forgetting parentheses after method call 11.incorrect semicolon at end of method header 12.leaving space after period when calling method 13.= incorrect operators

BRYN MAWR Java Programming Errors SIGCSE 2003 Semantic Errors 1.invoking class method on object

BRYN MAWR Java Programming Errors SIGCSE 2003 Logic Errors 1.improper casting 2.invoking a non-void method in a statement that requires a return value 3.flow reaches end of non-void method 4.confusion between declared and passed parameters 5.incompatibility between declared return type of a method and its invocation 6.class declared abstract because of missing function

BRYN MAWR Java Programming Errors SIGCSE 2003 Sample Run Code // sample run import java.awt.*; import java.applet.*; import java.awt.event.*; public class SampleRun extends Applet implements ActionListener { Label sampleLabel = new Label("Sample Label", Label.LEFT); Panel samplePanel = new Panel(); public void init();{ samplePanel.setLayout(new FlowLayout(FlowLayout.LEFT)); samplePanel.add(sampleLabel); add(samplePanel); repaint(); } public void paint(Graphics g){ char bear = 'p'; String cheese = "appleSauce"; computeSum(cheese, bear); } public int computeSum(int apple, int sauce){ int appleSauce; if (apple = sauce){ appleSauce= apple + sauce; } else if (apple > sauce);{ appleSauce == apple - sauce; } else{ appleSauce = 49; } return appleSauce; }

BRYN MAWR Java Programming Errors SIGCSE 2003 Sample Run Output

BRYN MAWR Java Programming Errors SIGCSE 2003 Demonstration

BRYN MAWR Java Programming Errors SIGCSE 2003 Results The list of common errors and the test suite can be useful educational tools for CS1 students. The Expresso project was a tremendous learning experience for the students who performed the research. Further assessment of Expresso in classroom and laboratory environments will help improve and evaluate the tool’s utility.

BRYN MAWR Java Programming Errors SIGCSE 2003 For Further Information Dr. Rebecca Mercuri Bryn Mawr College

BRYN MAWR Java Programming Errors SIGCSE 2003

BRYN MAWR Java Programming Errors SIGCSE 2003 Theoretical Framework Pea and Kurland – Cognitive Aspect –Define programming as both a mental mode and a skill like reading –Define the need for a tight bond between an instructional and programming environment Du Boulay – Language-Independent Aspect –Defines the five language-independent areas of difficulty and three kinds of corresponding mistakes Fleury – Java Aspect –Creates a list of the four most common “student-constructed rules” in Java –Explores how students understand Java code and what their misconceptions might be

BRYN MAWR Java Programming Errors SIGCSE 2003 Our aim in this project was to create an educational tool that would not only help students identify and fix their existing programming errors, but also help prevent them from making them again in the future. We accomplished this by compiling a list of common Java programming errors made by introductory students, designing and coding a program that identifies these mistakes and returns instructive error messages, and testing our program on our test suite. We believe that our resulting project will prove to be a very useful tool for future introductory Computer Science students.