Page MenuHomePhabricator

Investigate implementing a new voting methodology in SecurePoll [8H]
Closed, ResolvedPublic

Description

Motivation

It is likely that we would be working on implementing the Single Transferable Vote into SecurePoll over the coming weeks. This task is to investigate the generic changes needed to add a new voting methodology into SecurePoll.

Expected investigation output
  • List of changes to be made to SecurePoll to accommodate a new voting methodology (both UI and backend changes)
  • Document the process for adding the new methodology on the mediawiki page
Note
  • We'll follow this up with a more specific investigation for adding STV later, once we have confirmation on that.

Event Timeline

Niharika triaged this task as Medium priority.Apr 21 2021, 1:22 PM
Niharika created this task.
ARamirez_WMF renamed this task from Investigate implementing a new voting methodology in SecurePoll to Investigate implementing a new voting methodology in SecurePoll [8h].Apr 21 2021, 4:17 PM
Niharika renamed this task from Investigate implementing a new voting methodology in SecurePoll [8h] to Investigate implementing a new voting methodology in SecurePoll.Apr 21 2021, 4:17 PM
Niharika updated the task description. (Show Details)
ARamirez_WMF renamed this task from Investigate implementing a new voting methodology in SecurePoll to Investigate implementing a new voting methodology in SecurePoll [8H].Apr 21 2021, 4:18 PM

Overview

The Board Governance Committee (BGC) have asked AHT to implement the STV voting method in SecurePoll for the next Board Election.

This is a high-level outline of the initial technical implementation work we will need to do. After the initial implementation phase, we will need a (probably longer) phase for testing at scale, with different languages, across wikis, etc; responding to the test feedback; re-testing, etc.

Initial technical work

It looks as though we can broadly break this into three parts:

  • Improve unit test coverage
  • Add tallying algorithm
  • Add voting form
Improve unit test coverage

Doesn't depend on BGC approval

  • Ballot
    • add basic Ballot tests
    • add tests for Ballot subclasses
  • Tallier
    • add basic Tallier tests
    • add tests for Tallier subclasses
Add tallying algorithm

Dependency: choose STV implementation T281032 (needs BGC approval)
We could implement a basic stub of this class before BGC approval

Implementation:

  • Extend Tallier
  • Implement abstract methods:
    • addVote
    • loadJSONResult
    • getJSONResult
    • getHtmlResult
    • getTextResult
    • finishTally
  • Add new tallier type to Tallier::tallierTypes (behind feature flag)
  • Tallying algorithm is implemented in STVTallier::finishTally
Add voting form

Dependency: Design finalisation and BGC approval
We could implement this in 2 phases: (1) a basic design before BGC approval, then (2) the approved design

1. Basic design
  • Extend Ballot
  • Implement abstract methods:
    • getQuestionForm
    • submitQuestion
    • unpackRecord
    • convertScores
  • Wires up with STV types in STVBallot::getTallyTypes
  • Add new ballot type to Ballot::ballotTypes (behind feature flag)
2. Improve the STVBallot form
  • Implement or fix existing UI components
  • Wire UI components into STVBallot::getQuestionForm

@Niharika We discussed this in the engineering meeting - do you have any questions? I think we can start making some tasks, particularly for the testing, which we can start doing before we hear again from the BGC (though it sounds like we'll hear soon anyway).

@Tchanders This looks good! I agree, we can start with tasks. There are some design and STV-specific implementation questions I am still talking with the committee about. We should start with the generic bits.