You are working on a Node.js project that uses Jest for unit testing. Your task is to write a test for a function calculateTotal() that takes an array of numbers and returns the sum. You have asked GitHub Copilot to assist you in generating the unit test. Below is the code generated by Copilot:

Which two of the following actions would best ensure that the generated test properly validates the calculateTotal() function and follows best testing practices? (Select two)
You are using GitHub Copilot to generate a function that finds the maximum value in an array of numbers in Python. Which of the following prompt formats is most likely to generate the correct and efficient code?
You are part of a team working on a highly sensitive and proprietary software project. The team is considering using GitHub Copilot to accelerate development, but there are concerns about the tool’s limitations, especially regarding collaboration and proprietary code. What are some key limitations of GitHub Copilot that you should be aware of in this scenario? (Select two)
You are developing an AI-based recruiting system and are using GitHub Copilot to help write code that filters job applicants based on their qualifications. Given that Copilot’s training data might contain historical biases (e.g., gender, race), how can you ensure that the code it generates does not inadvertently introduce bias into the system?
You are developing a Node.js web application with an authentication feature. Security is a critical concern, and you want to ensure that potential vulnerabilities like SQL injection and cross-site scripting (XSS) are adequately tested. You plan to use GitHub Copilot to improve your security testing strategy.
app.post('/login', async (req, res) => {
const { username, password } = req.body;
const query = `SELECT * FROM users WHERE username = '${username}' AND password = '${password}'`;
const user = await db.query(query);
if (user) {
res.status(200).send('Login successful');
} else {
res.status(401).send('Invalid credentials');
}
});
Which approach should you take to leverage GitHub Copilot for improving your security tests?
© Copyrights FreePDFQuestions 2026. All Rights Reserved
We use cookies to ensure that we give you the best experience on our website (FreePDFQuestions). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the FreePDFQuestions.