DEV 展示:OxCode 及用於評估程式碼修復的小型測試
Show DEV: OxCode, with a small test you can use to judge a coding fix
OxCode 團隊提供一組可自行執行的分頁測試,讓開發者評估這款 AI 軟件工程師修正程式碼錯誤的流程。OxCode 可在 VS Code 及相容編輯器內運作,並會在沙盒執行生成的程式碼、修復發現的錯誤;這組測試不代表 OxCode 的實際執行結果,也不能證明其基準效能。
I'm Barath, one of the people building OxCode in India. Early OxCode lacked proper context awareness, and we went back to improve how it understands a codebase before changing it.
OxCode is an AI software engineer inside VS Code and compatible editors. The part I'd like developers to evaluate is the checking loop: it runs generated code in a sandbox and fixes bugs it finds before reporting done.
Here's a reader-run evaluation you can try in your own editor. These are fixture tests. They don't report an OxCode run or establish benchmark performance.
Create paginate.cjs:
function paginate(items, page, pageSize) {
const start = page;
return items.slice(start, start + pageSize);
}
module.exports = { paginate };
Create paginate.test.cjs:
const test = require('node:test');
const assert = require('node:assert/strict');
const { paginate } = require('./paginate.cjs');
const items = ['a', 'b', 'c', 'd', 'e'];
test('page 1 starts with the first item', () => {
assert.deepEqual(paginate(items, 1, 2), ['a', 'b']);
});
test('page 2 starts after the first page', () => {
assert.deepEqual(paginate(items, 2, 2), ['c', 'd']);
});
test('the last page can be shorter', () => {
assert.deepEqual(paginate(items, 3, 2), ['e']);
});
Run node --test paginate.test.cjs in a local project with Node's built-in test runner. In the supplied fixture, pages are one-based. The start calculation is deliberately wrong.
Give OxCode this task:
Fix the one-based pagination bug. Keep the exported function and existing tests. Run node --test paginate.test.cjs and report the result. Keep changes limited to this bug.
Before accepting the change, read the diff and rerun that command yourself. Look for whether the tests stayed intact, whether the change is limited to the bug, and whether the reported command actually passed. If it cannot run the command, that should be stated clearly.
This fixture checks a narrow case. It doesn't establish performance on your repository, test empty inputs or define behavior for invalid page numbers. Add the checks your own project needs.
OxCode has a free plan with 15 runs daily and paid plans. Vibe and Teach modes are still coming soon. I'd like feedback on what evidence you need before accepting an agent's fix.
Product and installation: https://oxcode.ai
來源:DEV Community · dev.to
