# Large Language Models in Computer Science Classrooms: Ethical Challenges and Strategic Solutions
## 5 Tools and Strategies for Ensuring Academic Integrity
### Plagiarism Detection Methods
#### 5.3.1 Manual Detection of AI-Generated Code  
[PERSON] et al. [48] conducted research on the effects of ChatGPT in higher education, especially in software engineering and scientific writing. They advocated for the use of plagiarism detection and AI identification tools, in addition to manual inspection of work for signs of ChatGPT usage. Additionally, they suggested incorporating oral examinations or requiring documentation of the examination process as further strategies. Determining whether a code or programming essay came from an AI tool might be challenging, as the language model's outputs do not contain identifiable markers indicating their source. However, there are several methods that can be used to assess whether part of the code or programming project might have been generated by a language model such as ChatGPT:  
**Completely Standardized Code Patterns:** Language models often generate code that follows certain patterns, which may differ from human-written code. Specifically, its output aligns precisely with the standard stylistic guidelines of the language. For instance, in Python, ChatGPT's output adheres to the standards outlined in the official style guide for Python code [73]; specifically, certain coding style markers can indicate ChatGPT's output in Python code. * **Identifier naming conventions**: Short and lowercase function, variable, module, and package names, underscores used for clarity; CapWords convention for classes; uppercase with underscores for constants. * **Indentation**: Four spaces per indentation level; when continuing a line, an extra level of indentation is used to distinguish the continued line from the next code block. * **Specific spaces format**: One space before and one space after arithmetic, assignment, and comparison operators; one space after commas; no spaces immediately inside parentheses, brackets, or braces; and no space before a comma, semicolon, or colon. * **Blank lines**: Two blank lines to separate top-level functions and classes, one blank line to separate methods within a class; one blank line in functions to indicate logical sections. * **Specific type of comments**: block comments, inline comments, and docstrings with predefined guidelines for writing and formatting, as well as recommendations on which type to use for different situations. Even though the adoption of the official style is strongly suggested, developers tend to veer away from it occasionally. Hence, full adherence to the suggested style might raise suspicion. Consequently, a practical method to detect AI-crafted output from ChatGPT involves inspecting structural patterns in the text, such as unchanged formatting or repetitive function names. Figure 9 depicts an example of the code styling in ChatGPT-generated code, where the uniform styling according to the standard is noticeable. It is worth noting that automated refactoring tools are available to standardize existing code; PyCharm, for example, offers this functionality. If the goal is to identify code that has been automatically generated by examining uniform coding style, educators should request that students avoid using these tools when submitting assignments for evaluation. **Knowledge of Student's Proficiency:** The educator should become familiar with the typical programming proficiency of the student or the class. If the code submitted by a student is vastly different in style, quality, or complexity when compared to their previous work or the class average, further investigation may be warranted. These methods can only provide indicators or raise suspicions but cannot definitively confirm the origin of the code as AI-generated code. In order to conclusively determine this, additional evidence or insights from the student themselves may be required. Nonetheless, these techniques can provide a high probability of detecting potential cases of plagiarism. Consequently, these techniques serve as tools to help determine which students should be tested orally or asked additional questions to check their comprehension.