Kashyap Todi

53 papers A* 12A 9B 1Journal 12Unranked 18
YearRankTypeTitle / Venue / Authors
2026 A conf
IUI
Zheng Zhang, Mengjie Yu, Tianyi Wang, Kashyap Todi, Ajoy Savio Fernandes, Yue Liu, Haijun Xia, Tovi Grossman, Tanya R. Jonker
2026 J jnl
CoRR
Zheng Zhang, Mengjie Yu, Tianyi Wang, Kashyap Todi, Ajoy Savio Fernandes, Yue Liu, Haijun Xia, Tovi Grossman, Tanya R. Jonker
2025 A conf
IUI
Violet Yinuo Han, Tianyi Wang, Hyunsung Cho, Kashyap Todi, Ajoy Savio Fernandes, Andre Levi, Zheng Zhang, Tovi Grossman, Alexandra Ion, Tanya R. Jonker
2025 A conf
IUI
Hai Dang, Ben Lafreniere, Tovi Grossman, Kashyap Todi, Michelle Li
2025 A* conf
CHI
Hyunsung Cho, Jacqui Fashimpaur, Naveen Sendhilnathan, Jonathan Browder, David Lindlbauer, Tanya R. Jonker, Kashyap Todi
2025 conf
SUI
John J. Dudley, Amy Karlson, Kashyap Todi, Matt Longest, Hrvoje Benko, Robert Wang, Per Ola Kristensson
2025 A* conf
UIST
Jacqui Fashimpaur, Tovi Grossman, Ben Lafreniere, Naveen Sendhilnathan, Kashyap Todi, Tianyi Wang, Ting Zhang, Tanya R. Jonker
2024 A* conf
ISMAR
John J. Dudley, Amy Karlson, Kashyap Todi, Hrvoje Benko, Matt Longest, Robert Wang, Per Ola Kristensson
2024 A* conf
CHI
Xun Qian, Tianyi Wang, Xuhai Xu, Tanya R. Jonker, Kashyap Todi
2024 J jnl
CoRR
Xun Qian, Tianyi Wang, Xuhai Xu, Tanya R. Jonker, Kashyap Todi
2024 A conf
IUI
Jason Wu, Kashyap Todi, Joannes Chan, Brad A. Myers, Ben Lafreniere
2024 A* conf
CHI
Hyunsung Cho, Yukang Yan, Kashyap Todi, Mark Parent, Missie Smith, Tanya R. Jonker, Hrvoje Benko, David Lindlbauer
2024 J jnl
CoRR
Hyunsung Cho, Yukang Yan, Kashyap Todi, Mark Parent, Missie Smith, Tanya R. Jonker, Hrvoje Benko, David Lindlbauer
2024 A* conf
UIST
Hyunsung Cho, Naveen Sendhilnathan, Michael Nebeling, Tianyi Wang, Purnima Padmanabhan, Jonathan Browder, David Lindlbauer, Tanya R. Jonker, Kashyap Todi
2024 J jnl
CoRR
Hyunsung Cho, Naveen Sendhilnathan, Michael Nebeling, Tianyi Wang, Purnima Padmanabhan, Jonathan Browder, David Lindlbauer, Tanya R. Jonker, Kashyap Todi
2023 J jnl
CoRR
Kashyap Todi, Tanya R. Jonker
2023 A* conf
CHI
Xuhai Xu, Anna Yu, Tanya R. Jonker, Kashyap Todi, Feiyu Lu, Xun Qian, João Marcelo Evangelista Belo, Tianyi Wang, Michelle Li, Aran Mun, Te-yen Wu, Junxiao Shen, Ting Zhang, Narine Kokhlikyan, Fulton Wang, Paul Sorenson, Sophie Kahyun Kim, Hrvoje Benko
2023 J jnl
CoRR
Xuhai Xu, Mengjie Yu, Tanya R. Jonker, Kashyap Todi, Feiyu Lu, Xun Qian, João Marcelo Evangelista Belo, Tianyi Wang, Michelle Li, Aran Mun, Te-yen Wu, Junxiao Shen, Ting Zhang, Narine Kokhlikyan, Fulton Wang, Paul Sorenson, Sophie Kahyun Kim, Hrvoje Benko
2022 J jnl
CoRR
Kashyap Todi, Ben Lafreniere, Tanya R. Jonker
2022 conf
CHI Extended Abstracts
SIGCHI Executive Committee, Adriana S. Vivacqua, Andrew L. Kun, Cale J. Passmore, Helena M. Mentis, Josh Andres, Kashyap Todi, Matt Jones, Luigi De Russis, Naomi Yamashita, Neha Kumar, Nicola J. Bidwell, Pejman Mirza-Babaei, Priya C. Kumar, Shaowen Bardzell, Simone Kriglstein, Susan M. Dray, Susanne Boll, Stacy M. Branham, Tamara L. Clegg
2022 conf
CHI Extended Abstracts
SIGCHI Executive Committee, Adriana S. Vivacqua, Andrew L. Kun, Cale J. Passmore, Helena M. Mentis, Josh Andres, Kashyap Todi, Luigi De Russis, Matt Jones, Naomi Yamashita, Neha Kumar, Nicola J. Bidwell, Pejman Mirza-Babaei, Priya C. Kumar, Shaowen Bardzell, Simone Kriglstein, Stacy M. Branham, Susan Dray, Susanne Boll, Tamara L. Clegg
2022 A* conf
CHI
Yi-Chi Liao, Kashyap Todi, Aditya Acharya, Antti Keurulainen, Andrew Howes, Antti Oulasvirta
2022 conf
CHI Extended Abstracts
SIGCHI Executive Committee, Adriana S. Vivacqua, Andrew L. Kun, Cale J. Passmore, Helena M. Mentis, Josh Andres, Kashyap Todi, Luigi De Russis, Matt Jones, Naomi Yamashita, Neha Kumar, Nicola J. Bidwell, Pejman Mirza-Babaei, Priya C. Kumar, Shaowen Bardzell, Simone Kriglstein, Stacy M. Branham, Susan M. Dray, Susanne Boll, Tamara L. Clegg
2021 A* conf
CHI
Kashyap Todi, Gilles Bailly, Luis A. Leiva, Antti Oulasvirta
2021 J jnl
CoRR
Kashyap Todi, Gilles Bailly, Luis A. Leiva, Antti Oulasvirta
2021 B conf
MobileHCI
Florian Heller, Kashyap Todi, Kris Luyten
2021 A conf
Conference on Designing Interactive Systems
Kashyap Todi, Luis A. Leiva, Daniel Buschek, Pin Tian, Antti Oulasvirta
2021 A conf
IUI
Niraj Ramesh Dayama, Simo Santala, Lukas Brückner, Kashyap Todi, Jingzhou Du, Antti Oulasvirta
2021 J jnl
CoRR
Yi-Chi Liao, Kashyap Todi, Aditya Acharya, Antti Keurulainen, Andrew Howes, Antti Oulasvirta
2020 conf
IUI Companion
Kashyap Todi, Jean Vanderdonckt, Xiaojuan Ma, Jeffrey Nichols, Nikola Banovic
2020 A* conf
CHI
Niraj Ramesh Dayama, Kashyap Todi, Taru Saarelainen, Antti Oulasvirta
2020 J jnl
CoRR
Niraj Ramesh Dayama, Kashyap Todi, Taru Saarelainen, Antti Oulasvirta
2020 J jnl
ACM Trans. Interact. Intell. Syst.
Kashyap Todi, Jussi Jokinen, Kris Luyten, Antti Oulasvirta
2019 conf
IUI Companion
Katri Leino, Kashyap Todi, Antti Oulasvirta, Mikko Kurimo
2019 conf
HTTF
Kashyap Todi
2019 J jnl
CoRR
Camille Gobert, Kashyap Todi, Gilles Bailly, Antti Oulasvirta
2019 A conf
IUI
Camille Gobert, Kashyap Todi, Gilles Bailly, Antti Oulasvirta
2019 conf
IUI Companion
Camille Gobert, Kashyap Todi, Gilles Bailly, Antti Oulasvirta
2018 conf
UIST (Adjunct Volume)
Antti Oulasvirta, Samuli De Pascale, Janin Koch, Thomas Langerak, Jussi Jokinen, Kashyap Todi, Markku Laine, Manoj Kristhombuge, Yuxi Zhu, Aliaksei Miniukovich, Gregorio Palmas, Tino Weinkauf
2018 A conf
IUI
Kashyap Todi, Jussi Jokinen, Kris Luyten, Antti Oulasvirta
2018
Kashyap Todi
2017 conf
MICI@CHI
Kashyap Todi, Daryl Weir, Antti Oulasvirta
2016 conf
CHI Extended Abstracts
Brent Berghmans, Axel Faes, Matthijs Kaminski, Kashyap Todi
2016 conf
CHI Extended Abstracts
Kashyap Todi, Donald Degraen, Brent Berghmans, Axel Faes, Matthijs Kaminski, Kris Luyten
2016 conf
CHI Extended Abstracts
Kashyap Todi, Daryl Weir, Antti Oulasvirta
2016 A conf
Conference on Designing Interactive Systems
Kashyap Todi, Daryl Weir, Antti Oulasvirta
2015 A* conf
CHI
Raf Ramakers, Kashyap Todi, Kris Luyten
2015 conf
CHI Extended Abstracts
Raf Ramakers, Kashyap Todi, Kris Luyten
2015 conf
SIGGRAPH Posters
Raf Ramakers, Kashyap Todi, Kris Luyten
2015 conf
SIGGRAPH Studio
Raf Ramakers, Kashyap Todi, Kris Luyten
2014 conf
CHI Extended Abstracts
Kashyap Todi, Kris Luyten
2014 A* conf
CHI
Chat Wacharamanotham, Kashyap Todi, Marty Pye, Jan O. Borchers
2012 conf
CSCW (Companion)
Mateusz Dolata, Ibrahim Cakir, Kashyap Todi, Nils Jeners
tests/unit/test_decompile_scores.py
← Index tests/unit/test_decompile_scores.py python
"""Unit tests for bninja/analysis/scores.py — ObfuscationScores."""
import sys
import pytest
from unittest.mock import MagicMock

# Install binaryninja stubs before importing
from tests.unit.conftest_binja_stubs import (
    install_binja_stubs,
    HighLevelILOperation,
)
bn_mock = install_binja_stubs()

from redb.extractors.decompiler.bninja.analysis.scores import (
    ObfuscationScores,
    get_dominated_by,
    uses_mba,
)
import binaryninja.highlevelil as hlil_mod


# ============================================================================
# Helper: Mock HLIL instruction
# ============================================================================

class MockHLILInstruction(hlil_mod.HighLevelILInstruction):
    """Mock HLIL instruction with operation and operands."""
    def __init__(self, operation, operands=None):
        self.operation = operation
        self.operands = operands or []


class MockHLILBasicBlock:
    """Mock HLIL basic block for flattened score testing."""
    def __init__(self, incoming_edges=None, dominator_tree_children=None):
        self.incoming_edges = incoming_edges or []
        self.dominator_tree_children = dominator_tree_children or []


# ============================================================================
# 5a. ObfuscationScores
# ============================================================================


class TestFlattenedScore:
    def test_flattened_score_no_back_edges(self):
        """Linear CFG with no back edges -> score 0.0."""
        block = MockHLILBasicBlock(incoming_edges=[], dominator_tree_children=[])
        func = MagicMock()
        func.basic_blocks = [block]
        scores = ObfuscationScores(func)
        assert scores.flattened_score() == 0.0

    def test_flattened_score_with_loop(self):
        """CFG with a back edge -> score > 0.0."""
        block = MockHLILBasicBlock(dominator_tree_children=[])
        # Create a back edge: an incoming edge whose source is in the dominated set
        edge = MagicMock()
        edge.source = block  # source IS the dominator -> back edge
        block.incoming_edges = [edge]
        func = MagicMock()
        func.basic_blocks = [block]
        scores = ObfuscationScores(func)
        assert scores.flattened_score() > 0.0

    def test_flattened_score_fully_flat(self):
        """Flattened CFG: one block dominates all -> ratio close to 1.0."""
        children = [MockHLILBasicBlock() for _ in range(4)]
        root = MockHLILBasicBlock(dominator_tree_children=children)
        # Back edge from root incoming
        edge = MagicMock()
        edge.source = root
        root.incoming_edges = [edge]
        all_blocks = [root] + children
        func = MagicMock()
        func.basic_blocks = all_blocks
        scores = ObfuscationScores(func)
        assert scores.flattened_score() == pytest.approx(1.0)


class TestMBAScore:
    def test_mba_score_no_mixed_ops(self):
        """Instructions with only arithmetic -> score 0.0."""
        instr = MockHLILInstruction(HighLevelILOperation.HLIL_ADD, operands=[])
        func = MagicMock()
        func.instructions = [instr]
        scores = ObfuscationScores(func)
        assert scores.MBA_score() == 0.0

    def test_mba_score_mixed_ops(self):
        """Instructions with arithmetic + logic -> score > 0.0."""
        inner_logic = MockHLILInstruction(HighLevelILOperation.HLIL_XOR, operands=[])
        outer_arith = MockHLILInstruction(
            HighLevelILOperation.HLIL_ADD, operands=[inner_logic]
        )
        func = MagicMock()
        func.instructions = [outer_arith]
        scores = ObfuscationScores(func)
        assert scores.MBA_score() > 0.0

    def test_mba_score_all_mixed(self):
        """Every instruction has both -> score 1.0."""
        inner_logic = MockHLILInstruction(HighLevelILOperation.HLIL_NOT, operands=[])
        outer_arith = MockHLILInstruction(
            HighLevelILOperation.HLIL_SUB, operands=[inner_logic]
        )
        func = MagicMock()
        func.instructions = [outer_arith]
        scores = ObfuscationScores(func)
        assert scores.MBA_score() == 1.0


class TestGetDominatedBy:
    def test_get_dominated_by(self):
        child1 = MockHLILBasicBlock(dominator_tree_children=[])
        child2 = MockHLILBasicBlock(dominator_tree_children=[])
        root = MockHLILBasicBlock(dominator_tree_children=[child1, child2])
        result = get_dominated_by(root)
        assert root in result
        assert child1 in result
        assert child2 in result
        assert len(result) == 3


class TestUsesMBA:
    def test_uses_mba_arithmetic_only(self):
        instr = MockHLILInstruction(HighLevelILOperation.HLIL_ADD, operands=[])
        assert uses_mba(instr) is False

    def test_uses_mba_logic_only(self):
        instr = MockHLILInstruction(HighLevelILOperation.HLIL_XOR, operands=[])
        assert uses_mba(instr) is False

    def test_uses_mba_mixed(self):
        inner = MockHLILInstruction(HighLevelILOperation.HLIL_AND, operands=[])
        outer = MockHLILInstruction(HighLevelILOperation.HLIL_ADD, operands=[inner])
        assert uses_mba(outer) is True