首页 > > 详细

CSSE2310/CSSE7231 Documentation required for the use of AI tools

  CSSE2310/CSSE7231

Documentation required for the use of AI tools
Version 1.0
The University of Queensland
School of Information Technology and Electrical Engineering
February 2023
CSSE2310/7231 assignments may permit the inclusion of code generated by AI tools. If this is the case then it 1
will be clearly specified in the assignment specification. If such use is permitted and you do use such a tool, then 2
you must reference the use in your code as described in the style guide. You must also fully document your use of 3
the tool(s) in a text file that accompanies your submission. 4
The use of such tools is NOT expected or required in this course and the teaching staff would 5
prefer that you did not use such tools as they may hinder your learning, may introduce bugs in your 6
code, and it may actually take you longer to complete an assignment than if you had not used the 7
tool(s). 8
In commercial environments, the use of such tools is being treated warily, if not disallowed altogether. The code 9
that is generated may include snippets that are copied from other projects and are subject to particular licensing 10
requirements, e.g. that the code can’t be used in a commercial project, or that particular attribution is required, 11
etc. It has also been found that the code generated by such tools can introduce subtle bugs and security issues into 12
your work. 13
If the use of such tools is permitted in a CSSE2310/CSSE7231 assignment and you decide to use one or more 14
such tools, then it is your responsibility to check the code that is generated actually does what you need it to AND 15
to make sure you understand the code1 AND to appropriately reference/attribute the code in your source file(s) 16
AND to document the use of the tool(s) fully. 17
Your documentation must be in a file named toolHistory.txt and committed to your repository (in the same 18
directory as your source code for the assignment). The file must be committed to your repository with the first 19
commit that contains any code generated by such tools – and must be kept up to date with all subsequent commits. 20
You can not wait until your last commit before submission to update the file – you must keep it up to date as you 21
work on the assignment. 22
It is entirely possible that the contents of this file will be much longer than the code itself. This process may 23
also take you longer than if you had just written the code yourself. 24
1 General Guidelines 25
Your toolHistory.txt file must be a plain text file that can be opened (and edited) with a text editor (e.g. Vim). 26
You must include timestamps to indicate when you used or interacted with the tool (or started interacting with 27
the tool in a single session) and you must specify which tool you were using. It expected that if you use a tool over 28
multiple sessions that you just append details of later sessions to those already in the file from earlier sessions. 29
You must capture all of your interactions with such tools that result in code or comments that you commit to 30
your repository – at the time you make those code commits. If you remove tool generated code from your work, then 31
you may update your toolHistory.txt file to delete the details of the tool interaction(s) that created that code 32
and commit those changes at the same time (i.e. your toolHistory.txt file always reflects the current commit). If 33
you delete all such code you can remove the file from your repository also. It is also acceptable if you maintain the 34
full history of your tool interaction in the file, i.e. never delete anything, even if you remove tool generated code. 35
1You may be asked to explain and/or modify your code as part of the marking process. Inability to do so may result in failure of
the assignment and/or misconduct allegations being made against you.
© 2023 The University of Queensland 1
CSSE2310/CSSE7231 – Documentation required for the use of AI tools
The important requirement is that for any commit to your repository, the toolHistory.txt file must contain at 36
least the details of all tool interactions that have resulted in code or comments present in that commit. 37
It is expected that you might have to modify the code generated by such tool(s) to fix bugs or add features. 38
You do not have to capture the details of your own modifications to generated code here, but you should include a 39
comment in your code reference (see the Style Guide) that indicates that you modified the tool output. 40
If you use such a tool to help you debug code that you wrote, and this results in you modifying your code, then 41
you must capture the details in your toolHistory.txt file – i.e. you have created/modified code because of an 42
interaction with an AI tool, so the details must be captured. 43
There are no line length restrictions in the toolHistory.txt file, but the file should be formatted in such a way 44
that it is easy to read. 45
2 Tools That Capture Interactions 46
For tools that capture your interactions with them (e.g. ChatGPT), then your toolHistory.txt file must include 47
the full transcript(s) of your interaction(s) with the tool. There is no need to reformat this, and it is permissible 48
for artefacts to appear if you copy and paste the conversation, e.g. the “Copy code” text in the example below is 49
from the “Copy code” button presented with code examples in ChatGPT. You can add separators, blank lines etc. 50
to make the file more readable if you wish. 51
For example: 52
1 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2 Wednesday 22 February 2023 2:48pm − interaction wtih ChatGPT
3 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
4 p.sutton@uq.edu.au
5 Write a C function that calculates the largest of the absolute values of two integer arguments.
6 Here’s an example C function that takes two integer arguments and returns the largest of the absolute
values of those integers:
7
8 c
9 Copy code
10 #include
11
12 int max abs(int a, int b) {
13 int abs a = abs(a);
14 int abs b = abs(b);
15 return abs a > abs b ? abs a : abs b;
16 }
17 This function first uses the abs() function from the standard library to calculate the absolute values
of the input integers a and b. It then compares the absolute values using the ternary operator ? :,
and returns the larger absolute value.
18
19 You can call this function with two integers as follows:
20
21 scss
22 Copy code
23 int result = max abs(−10, 5);
24 This will set the result variable to the absolute value of −10, since it has a larger absolute value
than 5.
25
26
27
28
29 p.sutton@uq.edu.au
30 Please rewrite the function without using the ternary operator.
31 Sure! Here’s the same function as before, but without using the ternary operator:
32
33 c
34 Copy code
35 #include
36
37 int max abs(int a, int b) {
38 int abs a = abs(a);
39 int abs b = abs(b);
40
41 if (abs a > abs b) {
42 return abs a;
© 2023 The University of Queensland 2
CSSE2310/CSSE7231 – Documentation required for the use of AI tools
43 } else {
44 return abs b;
45 }
46 }
47 This function is identical to the previous one, except that it uses an if statement to check which
absolute value is larger, and then returns the corresponding value.
48
49 You can call this function in the same way as before:
50
51 scss
52 Copy code
53 int result = max abs(−10, 5);
54 This will set the result variable to the absolute value of −10, since it has a larger absolute value
than 5.
Example 1: ChatGPT code generation conversation example
3 Tools that Autocomplete 53
For tools that provide auto-completion suggestions (e.g. Github Copilot), then you must capture all of: 54
• the context – a brief description of the types and functions you have declared/defined so far (if this has not 55
been previously captured as the output from such a tool, e.g. if you wrote it yourself); 56
• the prompt – the text you have just entered at the moment just before you accept an autocomplete suggestion; 57
and 58
• the accepted suggestion. 59
1 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2 Wednesday 22 February 2023 3:05pm − interaction with GitHub Copillot
3 −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
4 Context
5 A file that has a single structure definition:
6 struct nums {
7 int a,b,c;
8 };
9
10 Prompt
11 // Function to return the largest member of struct nums
12 Accepted suggestion:
13 int largest(struct nums *n) {
14 int max = n−>a;
15 if (n−>b > max) max = n−>b;
16 if (n−>c > max) max = n−>c;
17 return max;
18 }
Example 2: GitHub Copilot code generation example
There is no need to show autocomplete suggestions that you do not accept. 60
Capturing this information in appropriate detail is likely to be time consuming. 61
© 2023 The University of Queensland 3
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!